170 likes | 326 Vues
This course provides an in-depth understanding of how to utilize R packages for data analysis, including installation and loading procedures, package repositories (CRAN and Bioconductor), and the benefits of using BiocLite for package management. It outlines the process for installing packages, accessing help files, and using vignettes to enhance your R programming experience. With access to over 2,390 packages on CRAN and 389 on Bioconductor, this resource is essential for anyone looking to expand their data analysis toolkit in R.
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