I have a n by m data.frame where column 1 has the information of interest. I want to create sub data.frames based upon what the value in a row of colum
data.frame
Instead of :
s <- data.frame(df1$P = S)
try:
s <- data.frame(df1[df1$P == S,])
or
s <- data.frame(df1[df1$P == 'S',])
if you want to control number of rows try:
s <- data.frame(df1[df1$P == 'S',1:5])