Contents
 
Introduction
To R

Miscellaneous Object Stuff

What Have I Got?

Now you've created a few objects you'll want to keep track of them. The ls() function shows what you have:
> 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...

Can I Get Rid Of It?

There is a function for deleting things remove() (or simply rm()). Just give it the object you dont care for anymore:
> 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.

Tell Me More...

The summary() function is quite useful. For a numeric vector it gives you a quick summary:
> 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.0
For a character vector, you dont get much:
> summary(c5)
 Length      Mode 
 6      character
But for a factor you get a table:
> summary(f5)
Female   Male 
     3      3

Contents