## ------------------------------------------------------------- a <- 2 b <- 1:10 ## ------------------------------------------------------------- ls() ## ------------------------------------------------------------- rm(a) ## ------------------------------------------------------------- rm(list=ls()) ## ------------------------------------------------------------- save.image(file="myobjects.RData") ## ------------------------------------------------------------- load("myobjects.RData") ## ------------------------------------------------------------- getwd() ## ----eval=F--------------------------------------------------- ## install.packages("ggplot2") ## ----eval=F--------------------------------------------------- ## library(ggplot2) ## ------------------------------------------------------------- vignette(package = "ggplot2") ## ----eval=F--------------------------------------------------- ## vignette("extending-ggplot2", package = "ggplot2") ## ----eval=F--------------------------------------------------- ## help("read.table") ## # o ## ?read.table ## ----eval = F------------------------------------------------- ## help.start() ## ------------------------------------------------------------- 1+2+3 2+3*4 2+(3*4) (2 + 3) * 4 3/2+1 4*3^3 ## ------------------------------------------------------------- 2 > 10 2 <= 10 5!=5 ## ------------------------------------------------------------- "Hello" ## ----eval = FALSE--------------------------------------------- ## ## Note: Generic code ## [name of object] <- [thing I want to save] ## ------------------------------------------------------------- x <- sqrt(2) ## ------------------------------------------------------------- x # Print the object x ## ------------------------------------------------------------- x^3 -> y y z <- log(y)+x z word <- "Hello" n <- nchar(word) ## ----include = F---------------------------------------------- log(9, base = 3) 119%%13 ; 119%/%13 (7 + 3 - 5 * 2) == ((7 + 3) - (5 * 2)) 574%/%7 * 7 == 574 x <- 5.0359 ceiling(x) floor(x) round(x, 2)