(original) (raw)
################################################### ### chunk number 1: ################################################### options(width=40) ################################################### ### chunk number 2: eval=FALSE ################################################### ## q() ################################################### ### chunk number 3: eval=FALSE ################################################### ## q("no") ################################################### ### chunk number 4: eval=FALSE ################################################### ## help("LoQueBuscas") ################################################### ### chunk number 5: eval=FALSE ################################################### ## ?LoQueBuscas ################################################### ### chunk number 6: eval=FALSE ################################################### ## Help("quit") ################################################### ### chunk number 7: eval=FALSE ################################################### ## help.start() ## ?q ################################################### ### chunk number 8: ################################################### apropos("quit") ################################################### ### chunk number 9: ################################################### args(apropos) ################################################### ### chunk number 10: eval=FALSE ################################################### ## RSiteSearch("help") ################################################### ### chunk number 11: ################################################### apropos("session") ################################################### ### chunk number 12: ################################################### 2 + 3 ################################################### ### chunk number 13: ################################################### 2 / 3 ################################################### ### chunk number 14: ################################################### 2 ^ 3 ################################################### ### chunk number 15: ################################################### log(3, base = 2) ################################################### ### chunk number 16: ################################################### sqrt(2) ################################################### ### chunk number 17: ################################################### pi ################################################### ### chunk number 18: ################################################### 1e6 / 100000 ################################################### ### chunk number 19: ################################################### 3 > 2 ################################################### ### chunk number 20: ################################################### 3 > 2 & 3 < 4 ################################################### ### chunk number 21: ################################################### x <- 2 x > 2 x <= 2 & x^2 < 5 ################################################### ### chunk number 22: ################################################### if (x < 3) { print("hola") } ################################################### ### chunk number 23: ################################################### if (x < 2) { print("hola") } else { print("boo") } ################################################### ### chunk number 24: ################################################### if (x < 2) { print("hola") } else if (x < 1){ print("boo") } else { print("loteria") } ################################################### ### chunk number 25: eval=FALSE ################################################### ## x <- 1.2 ## if (x > 2) { ## print("opcion1") ## } else if (x < 0){ ## print("opcion2") ## } else if (x^2 < 3){ ## print("opcion3") ## } else { ## print("no se") ## } ################################################### ### chunk number 26: ################################################### x <- 5 ifelse( x / 5 == 1, "Verdadero", "Falso") ################################################### ### chunk number 27: ################################################### c(2, 3) c(2, 7, 3) ################################################### ### chunk number 28: ################################################### 1:4 6:3 c(1:3, 8, 0:-3) ################################################### ### chunk number 29: ################################################### seq(10, 100, by=10) ################################################### ### chunk number 30: ################################################### rep(2, 3) ################################################### ### chunk number 31: ################################################### c( 1:3, 8, 0:-2, rep(5,4), seq(0,50, by=5) ) ################################################### ### chunk number 32: ################################################### for (i in 1:10) { if (sqrt(i) > 2.5) { print("sip") } else { print("nop") } } ################################################### ### chunk number 33: ################################################### res <- NULL for (i in 1:10) { res <- c(res, i^2) } res ################################################### ### chunk number 34: ################################################### res <- NULL for (i in 1:10) { temp <- 0 for (j in 1:10) { temp <- temp + i } res <- c(res, temp) } res ################################################### ### chunk number 35: eval=FALSE ################################################### ## save.image(file = "archivo.Rdata") ## load(file = "archivo.Rdata") ################################################### ### chunk number 36: eval=FALSE ################################################### ## save(objeto, file = "archivo.Rda") ################################################### ### chunk number 37: eval=FALSE ################################################### ## save(objeto1, objeto2, file = "archivo.Rda") ################################################### ### chunk number 38: eval=FALSE ################################################### ## load(file = "archivo.Rda") ################################################### ### chunk number 39: eval=FALSE ################################################### ## savehistory(file = "archivo.Rhistory") ################################################### ### chunk number 40: eval=FALSE ################################################### ## loadhistory(file = "archivo.Rhistory") ################################################### ### chunk number 41: ################################################### x <- 1:10 y <- x ^ 2 ################################################### ### chunk number 42: ################################################### plot(x,y) ################################################### ### chunk number 43: ################################################### pairs(iris[1:4], pch = 21, bg = c("red", "green3", "blue")[unclass(iris$Species)], lower.panel=NULL, labels=c("SL","SW","PL","PW"), font.labels=2, cex.labels=4.5, main = "Datos Iris de Anderson -- 3 especies") ################################################### ### chunk number 44: ################################################### sessionInfo()