I am very new to R and am trying to use it for generating a very large number of subsets (>4000), which my current script in JSL cannot handle. i would greatly appreciate if anyone could give me pointers on going about subsetting a table like the one below and saving them as .csv
using column name and row info.
set.seed(24)
DT = data.frame(Group=c("A","A","A","A","B","B","B","B","B"),Output1 = rnorm(9),Output2=rnorm(9),Output3=rnorm(9),Step=c("0","0","1","1","1","1","2","2","2"))
DT
I would like to subset this by Group,Output[i]
, Step and save as .csv
files with a particular naming convention "column_Step_Group.csv
". Examples shown below
Output1_0_A.csv
-0.5458808
0.5365853
Output2_0_A.csv
0.002311942
-1.316908124
Output1_2_B.csv
0.4445853
-0.4664951
-0.8483700