![]() |
Introduction
To R |
> ls() [1] "c3" "c4" "c5" "f5" "gt3" [6] "gt5" "last.warning" "x" "xeq4" "y" [11] "z2"Notice how the result is printed like a vector - because it is a vector! As with any R functions you can actually store it in an object:
> myobs <- ls() > myobs[2:5] [1] "c4" "c5" "f5" "gt3"You wont want to do this very often - perhaps never - but it illustrates how R often does things...
> x <- 1 > y <- 2 > rm(x) > remove(y)To delete everything in the working environment type:
> remove(list=ls()) REMOVES EVERYTHING!!!!!EEEK!!!You will get no warning, so don't do this unless you are really sure.
> x <- (1:100)**2 > summary(x) Min. 1st Qu. Median Mean 3rd Qu. Max. 1.0 663.3 2551.0 3384.0 5663.0 10000.0For a character vector, you dont get much:
> summary(c5) Length Mode 6 characterBut for a factor you get a table:
> summary(f5) Female Male 3 3