# Instructions RStudioServer -- 192.168.81.240:8787 user: stu... pass: student PDF documents: 10.9.1.1 # R / Bioconductor Data frame as complicated structure ```{r} df = data.frame(age=c(27, 32, 19), sex=factor(c("Male", "Female", NA))) olderIndividuals = df[df$age > 20, ] ``` What about a linear model? ```{r} x = rnorm(1000) y = x + rnorm(1000, sd=.5) df = data.frame(x=x, y=y) plot( y ~ x, df) fit = lm( y ~ x, df ) ``` S3 Objects ```{r} class(fit) ## what class is 'fit'? methods(class=class(fit)) ## discover available methods anova(fit) ## 'anova' is called a _generic_ ## 'anova.lm' is a specifc _method_ ``` S4 objects ```{r} library(Biostrings) dna = DNAStringSet(c("AATA", "AACCAA")) ```