Friday, September 09, 2011

R notes

Construct a list of lists

a = c(1,2,3)
b = c(4,5,6)
c = list(a, b)
d = list(c, list(a))    # different from list(c, a)
e = list(d, name="gerald")

Append to a list:

mylist[[length(mylist) + 1]] = obj

Append to a vector:

append(vec, val)

 

Type information

typeof(var),  class(var)

Resources

No comments: