- Homework 2 due today
- Homework 3 is out
- Read Introduction to Statistics with R (Chapter 8)
Patrick D. Schloss, PhD (microbialinformatics.github.io)
Department of Microbiology & Immunology
metadata <- read.table(file="wild.metadata.txt", header=T)
## Warning: cannot open file 'wild.metadata.txt': No such file or directory
## Error: cannot open the connection
rownames(metadata) <- metadata$Group
## Error: object 'metadata' not found
metadata <- metadata[,-1]
## Error: object 'metadata' not found
plot(metadata$Weight) # what is this using as an x-axis?
## Error: object 'metadata' not found
plot(metadata$Weight, metadata$Ear) # what is this using as an x-axis?
## Error: object 'metadata' not found
plot(metadata$Ear~metadata$Weight) # what is this using as an x-axis?
## Error: object 'metadata' not found
?plot
and ?plot.default
plot(metadata$Ear~metadata$Weight, col="blue", pch=18)
## Error: object 'metadata' not found
plot(metadata$Ear~metadata$Weight, col="blue", pch=20)
## Error: object 'metadata' not found
plot(metadata$Ear~metadata$Weight, col="blue", pch=20, cex=2)
## Error: object 'metadata' not found
points
plot(metadata[metadata$Sex=="M","Ear"]~metadata[metadata$Sex=="M","Weight"], col="blue", pch=18)
## Error: object 'metadata' not found
points(metadata[metadata$Sex=="F","Ear"]~metadata[metadata$Sex=="F","Weight"], col="pink", pch=20)
## Error: object 'metadata' not found
m.hist <- hist(metadata$Weight[metadata$Sex=="F"], breaks=10, ylim=c(0,20), xlim=c(0,30), col="pink")
## Error: object 'metadata' not found
f.hist <- hist(metadata$Weight[metadata$Sex=="M"], breaks=10, col="blue", add=T)
## Error: object 'metadata' not found
plot(m.hist$density~m.hist$mids, type="h", col="blue", ylim=c(0,0.2))
## Error: object 'm.hist' not found
points(f.hist$density~f.hist$mids, type="h", col="red")
## Error: object 'f.hist' not found
plot(m.hist$density~m.hist$mids, type="l", col="blue", ylim=c(0,0.2))
## Error: object 'm.hist' not found
points(f.hist$density~f.hist$mids, type="l", col="red")
## Error: object 'f.hist' not found
legend(x=20, y=0.18, legend=c("Female", "Male"), col=c("red", "blue"), lty=1, lwd=2)
## Error: plot.new has not been called yet
location <- locator(1)
## Error: plot.new has not been called yet
legend(location, legend=c("Female", "Male"), col=c("red", "blue"), lty=1, lwd=2)
## Error: object 'location' not found
location
## Error: object 'location' not found
abline(a=0.01, b=0.01)
## Error: plot.new has not been called yet
abline(v=20, col="red", lwd=3)
## Error: plot.new has not been called yet
abline(h=0.05, col="blue", lty=2, lwd=3)
## Error: plot.new has not been called yet
segments(x0=10, x1=15, y0=0.20, y1=0.15)
## Error: plot.new has not been called yet
segments(x0=c(10, 21), x1=c(15, 25), y0=c(0.20, 0.15), y1=c(0.15, 0.12))
## Error: plot.new has not been called yet