# # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- # fix the random.seed, so I'll always get the same answer: set.seed(10131985) x = c(a=1,b=2.4,c="chars1",d=NA,e=5.4,f=10,g="chars2",h=NA) x is.vector(x) is.na(x) v = as.vector(x) is.na(v) # remove NA's: v[ !is.na(v) ]