Package rafalib. R topics documented: August 29, Version 1.0.0

Similar documents
Package Mondrian. R topics documented: March 4, Type Package

Package pairsd3. R topics documented: August 29, Title D3 Scatterplot Matrices Version 0.1.0

Package ICSShiny. April 1, 2018

Package superbiclust

Package smoothr. April 4, 2018

Package WhiteStripe. April 19, 2018

Package ezsim. R topics documented: February 19, Type Package

Package rivernet. May 12, 2017

Package diagis. January 25, 2018

Package kdetrees. February 20, 2015

Package zebu. R topics documented: October 24, 2017

Package sciplot. February 15, 2013

Package lvplot. August 29, 2016

Package EnQuireR. R topics documented: February 19, Type Package Title A package dedicated to questionnaires Version 0.

Package OLScurve. August 29, 2016

Statistics 251: Statistical Methods

Package batchmeans. R topics documented: July 4, Version Date

Package SPIn. R topics documented: February 19, Type Package

Package superheat. February 4, 2017

Package meme. November 2, 2017

Package accrued. R topics documented: August 24, Type Package

Package statip. July 31, 2018

Lab 4: Distributions of random variables

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package SiZer. February 19, 2015

Package ellipse. January 6, 2018

Package narray. January 28, 2018

Package d3heatmap. February 1, 2018

Package corclass. R topics documented: January 20, 2016

The nor1mix Package. August 3, 2006

Package mcmcse. February 15, 2013

Package crank. R topics documented: January 22, Version Title Completing ranks Date Author Jim Lemon

Package abf2. March 4, 2015

Package clustmixtype

Package waterfall. R topics documented: February 15, Type Package. Version Date Title Waterfall Charts in R

Package meme. December 6, 2017

Package kdtools. April 26, 2018

Package msda. February 20, 2015

Package datasets.load

Package vipor. March 22, 2017

Package descriptr. March 20, 2018

The nor1mix Package. June 12, 2007

R topics documented: 2 genbernoullidata

Package enpls. May 14, 2018

Package Rramas. November 25, 2017

Package EM.Fuzzy. August 16, 2018

Package fitur. March 11, 2018

Package slam. December 1, 2016

Package dyncorr. R topics documented: December 10, Title Dynamic Correlation Package Version Date

Package PCADSC. April 19, 2017

Package spark. July 21, 2017

Package CINID. February 19, 2015

Package nplr. August 1, 2015

Package ggsubplot. February 15, 2013

CARTWARE Documentation

Package GLDreg. February 28, 2017

Package infer. July 11, Type Package Title Tidy Statistical Inference Version 0.3.0

Package customlayout

Package iosmooth. R topics documented: February 20, 2015

Package TANDEM. R topics documented: June 15, Type Package

R practice. Eric Gilleland. 20th May 2015

Package ClustGeo. R topics documented: July 14, Type Package

Data Visualization. Andrew Jaffe Instructor

Package arphit. March 28, 2019

Package anidom. July 25, 2017

DSCI 325: Handout 18 Introduction to Graphics in R

Package rtsplot. September 15, 2018

Package qicharts. October 7, 2014

Package seg. February 15, 2013

Package bdots. March 12, 2018

LAB #2: SAMPLING, SAMPLING DISTRIBUTIONS, AND THE CLT

Tutorial script for whole-cell MALDI-TOF analysis

Package R2SWF. R topics documented: February 15, Version 0.4. Title Convert R Graphics to Flash Animations. Date

Package mgc. April 13, 2018

Package rggobi. August 31, 2016

Package sankey. R topics documented: October 22, 2017

Package enrichplot. September 29, 2018

> glucose = c(81, 85, 93, 93, 99, 76, 75, 84, 78, 84, 81, 82, 89, + 81, 96, 82, 74, 70, 84, 86, 80, 70, 131, 75, 88, 102, 115, + 89, 82, 79, 106)

Package ggextra. April 4, 2018

Package naivebayes. R topics documented: January 3, Type Package. Title High Performance Implementation of the Naive Bayes Algorithm

CIND123 Module 6.2 Screen Capture

Package profvis. R topics documented:

CHAPTER 6. The Normal Probability Distribution

Package dupradar. R topics documented: July 12, Type Package

Stat 290: Lab 2. Introduction to R/S-Plus

Package slam. February 15, 2013

Package mfbvar. December 28, Type Package Title Mixed-Frequency Bayesian VAR Models Version Date

Statistics I Practice 2 Notes Probability and probabilistic models; Introduction of the statistical inference

Package LaF. November 20, 2017

Introduction to R and R-Studio Toy Program #1 R Essentials. This illustration Assumes that You Have Installed R and R-Studio

Derivatives 3: The Derivative as a Function

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package mathgraph. February 20, 2015

Package incidence. August 24, Type Package

Package spectrolab. October 28, 2018

Package mlegp. April 15, 2018

Statistical Programming with R

Package SCORPIUS. June 29, 2018

Package simed. November 27, 2017

Computing With R Handout 1

Transcription:

Version 1.0.0 Package rafalib August 29, 2016 Title Convenience Functions for Routine Data Eploration A series of shortcuts for routine tasks originally developed by Rafael A. Irizarry to facilitate data eploration. Author Rafael A. Irizarry and Michael I. Love Maintainer Rafael A. Irizarry <rafa@jimmy.harvard.edu> Imports RColorBrewer License Artistic-2.0 LazyData yes NeedsCompilation no Repository CRAN Date/Publication 2015-08-09 00:00:40 R topics documented: as.fumeric.......................................... 2 bartab............................................ 2 imagemat.......................................... 3 imagesort.......................................... 4 install_bioc......................................... 4 largeobj........................................... 5 maplot............................................ 5 mypar............................................ 6 myplclust.......................................... 7 nullplot........................................... 8 peek............................................. 8 popsd............................................ 9 popvar............................................ 9 sboplot........................................... 10 shist............................................. 10 splitit............................................ 11 splot............................................. 12 Inde 13 1

2 bartab as.fumeric converts to factor and then numeric Converts a vector of characters into factors and then converts these into numeric. as.fumeric(, levels = unique()) levels a character vector the leves to be used in the call to factor Rafael A. Irizarry Eamples group = c("a","a","b","b") plot(seq_along(group),col=as.fumeric(group)) bartab bartab Plot the overlap of three groups with a barplot bartab(, y, z, names, skipnone = FALSE,...) logical y logical z logical names a character vector of length 3 skipnone remove the "none" group... further arguments passed on to barplot

imagemat 3 Michael I. Love imagemat image of a matri Produces an image of a matri which matches the natural orientation. imagemat(, col = colorramppalette(c("white", "black"))(9), las = 1, lab = "", ylab = "",...) the matri col the colors las as in par lab -ais title ylab y-ais title... arguments passed to image Michael I. Love Eamples <- matri(c(1,0,0,0,1, 1,1,0,1,1, 1,0,1,0,1, 1,0,0,0,1, 1,0,0,0,1), ncol=5,byrow=true) imagemat()

4 install_bioc imagesort image with sorted rows the rows are sorted such that the first column has 2 blocks, the second column has 4 blocks, etc. see eample("imagesort") imagesort(, col = c("white", "black"),...) a matri of 0s and 1s col the colors of 0 and 1... arguments to heatmap Michael I. Love Eamples <- replicate(4,sample(0:1,40,true)) imagesort() install_bioc Install or update Bioconductor and CRAN packages This is function simply a wrapper for bioclite. It first sources the code from the Bioconductor site then calls bioclite. install_bioc(...)... arguments passed on to bioclite

largeobj 5 Details Note that once you run this function in a session, you no longer need to call since you can call bioclite directly. Rafael A. Irizarry largeobj What are the largest objects in memory? This function lists all the objects in the global environmnet and lists the n largest. largeobj(n = 5, units = "Mb") n units the number of objects to return units to display, see?object.size Value a named character string of the size of the n largest objects Michael I. Love maplot Bland Altman plot aka MA plot Takes two vectors and y and plots M=y- versus A=(+y)/2. If the vectors a more longer than length n the data is sampled to size n. A smooth curve is added to show trends. maplot(, y, n = 10000, subset = NULL, lab = NULL, ylab = NULL, curve.add = TRUE, curve.col = 2, curve.span = 1/2, curve.lwd = 2, curve.n = 2000,...)

6 mypar y n subset lab ylab curve.add curve.col curve.span curve.lwd curve.n a numeric vector a numeric vector a numeric value. If length() is larger than n, the and y are sampled down. inde of the points to be plotted a title for the ais a title for the y ais if TRUE a smooth curve is fit to the data and displayed. The function loess is used to fit the curve. a numeric value that determines the color of the smooth curve is passed on to loess as the span argument the line width for the smooth curve a numeric value that determines the sample size used to fit the curve. This makes fitting the curve faster with large datasets... further arguments passed to plot Rafael A. Irizarry Eamples n <- 10000 signal <- runif(n,4,15) bias <- (signal/5-2)^2 <- signal + rnorm(n) y <- signal + bias + rnorm(n) maplot(,y) mypar mypar Called without arguments, this function optimizes graphical parameters for the RStudio plot window. bigpar uses big fonts which are good for presentations. mypar(a = 1, b = 1, brewer.n = 8, brewer.name = "Dark2", ce.lab = 1, ce.main = 1.2, ce.ais = 1, mar = c(2.5, 2.5, 1.6, 1.1), mgp = c(1.5, 0.5, 0),...)

myplclust 7 a b brewer.n brewer.name ce.lab ce.main ce.ais mar mgp the first entry of the vector passed to mar the second entry of the vector passed to mar parameter n passed to brewer.pal parameters name passed to brewer.pal passed on to par passed on to par passed on to par passed on to par passed on to par... other parameters passed on to par Rafael A. Irizarry Eamples mypar() plot(cars) bigpar() plot(cars) myplclust plclust in colour Modifiction of plclust for plotting hclust objects in *in colour*! myplclust(hclust, labels = hclust$labels, lab.col = rep(1, length(hclust$labels)), hang = 0.1, lab = "", sub = "",...) hclust labels lab.col hang lab sub hclust object a character vector of labels of the leaves of the tree colour for the labels; NA=default device foreground colour as in hclust & plclust title for -ais (defaults to no title) subtitle (defualts to no subtitle)... further arguments passed to plot

8 peek Eva KF Chan nullplot nullplot Make an plot with nothing in it nullplot(1 = 0, 2 = 1, y1 = 0, y2 = 1, lab = "", ylab = "",...) 1 lowest -ais value 2 largest -ais value y1 lowest y-ais value y2 largest y-ais value lab -ais title, defaults to no title ylab y-ais title, defaults to no title... further arguments passed on to plot peek peek at the top of a tet file this returns a character vector which shows the top n lines of a file peek(, n = 2) n a filename the number of lines to return Michael I. Love

popsd 9 popsd population standard deviation Returns the population variance. Note that sd returns the unbiased sample estimate of the population varaince. It simply multiplies the result of var by (n-1) / n with n the populaton size and takes the square root. popsd(, na.rm = FALSE) na.rm a numeric vector or an R object which is coercible to one by as.vector(, "numeric"). logical. Should missing values be removed? popvar population variance Returns the population variance. Note that var returns the unbiased sample estimate of the population varaince. It simply multiplies the result of var by (n-1) / n with n the populaton size. popvar(,...) a numeric vector, matri or data frame.... further arguments passed along to var

10 shist sboplot smart boplot draws points or boes depending on sample size sboplot(,...) a named list of numeric vectors... further arguments passed on to boplot Eamples sboplot(list(a=rnorm(15),b=rnorm(75),c=rnorm(10000))) shist smooth histogram a smooth histogram with unit indicator (we re simply scaling the kernel density estimate). The advantage of this plot is its interpretability since the height of the curve represents the frequency of a interval of size unit around the point in question. Another advantage is that if z is a matri, curves are plotted together. shist(z, unit, bw = "nrd0", n, from, to, plothist = FALSE, add = FALSE, lab, ylab = "Frequency", lim, ylim, main,...) z unit bw n from to plothist the data the unit which determines the y ais scaling and is drawn arguments to density arguments to density arguments to density arguments to density a logical: should an actual histogram be drawn under curve?

splitit 11 add a logical: add should the curve be added to eisting plot? lab -ais title, defaults to no title ylab y-ais title, defaults to no title lim range of the -ais ylim range of the y-ais main an overall title for the plot: see title.... arguments to lines Eamples set.seed(1) = rnorm(50) par(mfrow=c(2,1)) hist(, breaks=-5:5) shist(, unit=1, lim=c(-5,5)) splitit split it Creates an list of indees for each unique entry of splitit() a vector Eamples <- c("a","a","b","a","b","c","b","b") splitit()

12 splot splot smart plot if n > 10,000, make a random subset of 10,000 and plot. You can also specify a specific subset to plot. If length of subset is larger than n, a random sample is still used to reduce data size. splot(, y, n = 10000, subset = NULL, lab = NULL, ylab = NULL,...) y n subset lab ylab the data the y data the number to subset eplicit subset inde (optional). title for the -ais title for the y-ais... further parameters passed on to plot Eamples <- rnorm(1e5) y <- rnorm(1e5) splot(,y,pch=16,col=rgb(0,0,0,.25))

Inde as.fumeric, 2 barplot, 2 bartab, 2 bigpar (mypar), 6 boplot, 10 brewer.pal, 7 hclust, 7 imagemat, 3 imagesort, 4 install_bioc, 4 largeobj, 5 loess, 6 maplot, 5 mypar, 6 myplclust, 7 nullplot, 8 par, 7 peek, 8 plclust, 7 plot, 6, 7 popsd, 9 popvar, 9 sboplot, 10 sd, 9 shist, 10 splitit, 11 splot, 12 title, 11 var, 9 13