170 likes | 303 Vues
Using R for Data Analysis. Course December 2010 Jelle Goeman Ren é e de Menezes. Packages. Packages: community created functions. Finding packages:. CRAN: Comprehensive R archive network http://cran.r-project.org/web/packages/ General repository for R packages 2390 packages available
E N D
Using R for Data Analysis Course December 2010 Jelle Goeman Renée de Menezes
Packages R Course
Finding packages: • CRAN: Comprehensive R archive network • http://cran.r-project.org/web/packages/ • General repository for R packages • 2390 packages available • Bioconductor • www.bioconductor.org • R Packages related to genomics • 389 packages available R Course
Package website: CRAN R Course
Package website: bioconductor R Course
Acquiring a package • Acquiring a package requires two steps: • Install: • Makes the package available on your PC • Do once (repeat if you have a new R version) • Load: • Makes the package available in your current R session • Do every time you use a package R Course
Install: by menu • Download zip file for your operating system • Install using menu • Packages… Install package from local zip file R Course
Install from prompt • Traditional way: > install.packages("penalized") • Recommended: use biocLite script > source("http://bioconductor.org/biocLite.R") > biocLite("globaltest") • Advantages of biocLite: • Automatically installs dependencies • Installs proper package version for your R version • Works for both CRAN and Bioconductor R Course
What does a package do? Vignettes • Many packages have a “Vignette” = manual • Obtain via package site • Or use the vignette command # list of all vignettes > vignette() # list of vignettes for a specific package > vignette(package="globaltest") # open a specific vignette > vignette("GlobalTest") R Course
Vignette and Reference manual R Course
What does a package do? Help files • Overview of a package’s help files • Go to menu…help…html help…packages • Obtain list of packages. Below: list of help files in the package R Course
Loading a package • Make the package’s functions available in the current R session > library(globaltest) > require(globaltest) R Course
Finding a package: CRAN task views R Course