An introduction to r cont
This presentation is the property of its rightful owner.
Sponsored Links
1 / 5

An introduction to R (cont) PowerPoint PPT Presentation


  • 95 Views
  • Uploaded on
  • Presentation posted in: General

An introduction to R (cont). Ståle Nygård ( [email protected] ) Department of Mathematics, University of Oslo 23.11.2007 Course in Statistical methods and bioinformatics for the analysis of microarray data. Packages in R. All R functions and datasets are stored in packages .

Download Presentation

An introduction to R (cont)

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


An introduction to r cont

An introduction to R (cont)

Ståle Nygård ([email protected])

Department of Mathematics, University of Oslo

23.11.2007

Course in Statistical methods and bioinformatics for the analysis of microarray data


Packages in r

Packages in R

  • All R functions and datasets are stored in packages.

  • Some packages are standard, the rest has to be installed and loaded.

  • A package is installed (or updated) by

    • Going to Install package(s) in the R menu line or

    • Typing

      > install.packages()

      (or > update.packages() )

  • To see which packages are installed at your site, issue the command

    > library()

    with no arguments.

  • Only when a package is loaded are its contents available.To load a particular package (e.g. the bioconductor affy package), use a command like

    > library(affy)

  • To see which packages are currently loaded, use

    > search()

    to display the search list.


Contributed packages and cran

Contributed packages and CRAN

  • There are hundreds of contributed packages for R, written by many different authors.

  • Some of these packages implement specialized statistical methods, others give access to data or hardware, and others are designed to complement textbooks.

  • Some (the recommended packages) are distributed with every binary distribution of R. Most are available for download from CRAN (http://CRAN.R-project.org/ and its mirrors), and other repositories such as Bioconductor (http://www.bioconductor.org/).


Working directories

Working directories

  • To set the working directory to e.g. C:/microarray, type

    > setwd(”C:/microarray”)

    (If you have a file microdata.txt stored in C:/microarray, you can then load the file by e.g. typing data=read.table(”microdata.txt”))

  • To find your current directory, type

    > getwd()

  • It is recommended that you should use separate working directories for different analyses conducted with R


Workspaces

Workspaces

  • During an R session, objects (variables, functions etc.) are created and stored by name. The collection of objects currently stored is called the workspace. The R command

    > objects()

    (alternatively, ls()) can be used to display the names of (most of) the objects which are currently stored within R.

  • At the end of each R session you are given the opportunity to save the workspace. If you indicate that you want to do this, the objects are written to a file called .RData in the current directory, and the command lines used in the session are saved to a file called .Rhistory.

  • When R is started at later time from the same directory it reloads the workspace and the associated commands history is reloaded from this file.


  • Login