Re: [R] arbitrary subset of dataframe

2013-08-26 Thread ONKELINX, Thierry
r-help-boun...@r-project.org] Namens catalin roibu Verzonden: maandag 26 augustus 2013 11:41 Aan: r-help@r-project.org Onderwerp: [R] arbitrary subset of dataframe Dear all! I want to arbitrary subset a data frame by variables. I try this code, but the subset work only for rows, but I want to subs

[R] arbitrary subset of dataframe

2013-08-26 Thread catalin roibu
Dear all! I want to arbitrary subset a data frame by variables. I try this code, but the subset work only for rows, but I want to subset by variables. # sample without replacement mysample <- df[sample(1:ncol(df), 50, replace=FALSE),] Please help me to solve this probl