Difference between revisions of "OR1Expt.R"
From Organic Design wiki
(New page: {{R}} {{#security: Sven,Goldfinger}}) |
|||
Line 1: | Line 1: | ||
{{R}} {{#security: Sven,Goldfinger}} | {{R}} {{#security: Sven,Goldfinger}} | ||
+ | |||
+ | sourceDir <- "/Volumes/HD2/Clinton/Data" | ||
+ | filename <- dir(sourceDir, pattern="OR1.+\.txt") | ||
+ | |||
+ | dset <- read.table(file.path(sourceDir, filename), sep="\t", header=TRUE) | ||
+ | |||
+ | dim(dset) | ||
+ | summary(dset) | ||
+ | # Convert names | ||
+ | colnames(dset)[4:5] <- c("AM","RE") | ||
+ | |||
+ | library(lattice) | ||
+ | |||
+ | # Formulas | ||
+ | # y ~ x | ||
+ | # y ~ x | z | ||
+ | # y ~ x | (z * w) | ||
+ | |||
+ | xyplot( RE ~ AM, data=dset) | ||
+ | xyplot( RE ~ Timepoint| AM * Treatment, data=dset, panel.superpose=dset$Amount, groups=Amount) |
Revision as of 22:59, 7 May 2007
Code snipits and programs written in R, S or S-PLUS {{#security: Sven,Goldfinger}}
sourceDir <- "/Volumes/HD2/Clinton/Data" filename <- dir(sourceDir, pattern="OR1.+\.txt")
dset <- read.table(file.path(sourceDir, filename), sep="\t", header=TRUE)
dim(dset) summary(dset)
- Convert names
colnames(dset)[4:5] <- c("AM","RE")
library(lattice)
- Formulas
- y ~ x
- y ~ x | z
- y ~ x | (z * w)
xyplot( RE ~ AM, data=dset) xyplot( RE ~ Timepoint| AM * Treatment, data=dset, panel.superpose=dset$Amount, groups=Amount)