Saturday, October 27, 2007

Introduction

### Installing Packages (Linux)
> options(CRAN = "http://cran.us.r-project.org/")
> install.packages("qtl")

> source("http://www.bioconductor.org/getBioC.R")
> getBioC("exprs")

### Install Bioconductor
> source("http://www.bioconductor.org/biocLite.R")
> biocLite()

### Update Packages (Linux)
> update.packages()

### RUNNING R
> help(polr)
> ?polr // the same
> help.search("polr")
> source("c:/power.txt")
> sink("a:/power.lst") // subsequent output from terminal can be saved as "a:/power.lst")
> sink() // restore output to the terminal
> ls() // dir> ls(pat=".dat$") // dir *.dat
> rm(x,X) // delete x & X (case-sensitive)

### RUNNING R in batch mode
# Windows
> Rcmd BATCH example.R

# Unix/Linux
> R CMD BATCH example.R

### Add default package and working directory
options(defaultPackages=c(getOption("defaultPackages"),"RWinEdt"))
setwd("G:/programming/R")

### Data
> library(affy)
> data(package="affy") // show all datasets in the package "affy"

> data(package="datasets")

### useful datasets

## PK/PD
# Indometh conc~time | Subject (2 compartment)
# Theoph (oral dose)
# Puromycin rate ~ conc state (PD)


# ChickWeight# trees# InsectSprays (1-way anaova)

# Orangecircumference ~ age Tree
# OrchardSprays (Latin Square)decrease ~ rowpos colpos treatment

# PlantGrowthweight group (1 cont, 2 trts)

# ability.cov : covariance matrix
# airquality
# attitude
# chickwts (1-way anova)

# esoph (glm)Smoking, Alcohol and (O)esophageal Cancer

# iris (cluster?)
# morley (speed of light)
# warpbreaks (2-way anova)

No comments: