Define many subset sequence in R -
assume have dataframe called data
contains column called col
contains numbers 0 10'000.
how create following subset function subset
in r can called sub
- numbers 999 1200 and
- numbers 1500 1599
edit: i've tried sub<- subset(data, col >= 999 & col <= 1200 | col >= 1500& col <= 1599)
i'm not sure i'm right doing so.
the problem in logic - need use parentheses keep relevant statements together:
sub<- subset(data, (col >= 999 & col <= 1200) | (col >= 1500& col <= 1599))
although honest, think way did technically work.
Comments
Post a Comment