Indexing

names(CO2)

CO2$Treatment

CO2[,3]

CO2[3,]

CO2[1:6,]

CO2[c(1,2,3,4,5,6),3]

CO2$Treatment[1:6]

CO2[CO2$conc>100,]

CO2[CO2$Treatment=="chilled",]

CO2[sample(nrow(CO2), 10),]

available named columns

"Treatment" column

all rows, column 3

row 3, all columns

rows 1-6, all columns

rows 1-6, column 3

elements 1-6 of Treatment

rows where conc > 100

rows where Treatment == “chilled"

10 random rows