Select column dataframe index R -
i have data frame df this
1 2 3 4 b c where colnames {1,2,3,4}. select 1 of column of data frame according index set externally
colf <- as.numeric(mo) fmo <- df[[colf]] many thanks,
treat data frame matrix , index using [row,column] notation, i.e.
fmo = df[,colf] this column number colf.
Comments
Post a Comment