Skip to content
Prev 2102 / 7420 Next

subsetting data in R

If this isn't already answered:

  I don't quite understand the question: what do you mean by "do a
complete data set from an object in R"?  What do you mean by "the
subsetting is dangerous ... as you need to specify the levels for all
your factors again"?

  (What do your 3000 columns of data represent?  If these are predictor
variables I hope you have a truly enormous number of responses ...)

  It may have been mentioned already, but droplevels(subset(...)) will
probably do what you want.  (I have tried very hard over the years to
get drop.levels= to be an optional argument to subset(), but so far I
have failed.  droplevels() is an improvement over the drop.levels()
function in gdata because (1) it is in base R and (2) it doesn't reorder
the factor by default (which is what gdata::drop.levels [insanely in my
opinion] does).
On 11-04-24 11:21 AM, Manuel Sp?nola wrote: