Displaying 1 result from an estimated 1 matches for "same_cel".
Did you mean:
same_cell
2009 Oct 13
2
splitting dataframe, assign to new dataframe, add new rows to new dataframe
...ana 0.15
chicken 1.00
>df3
classes mass
pear 0.30
Below shows what I have tried. The main problem I have = I don't know how to assign the selected instance into a new dataframe with a name which is generated 'on-the-fly' based on the value of j (the jth row).
for (i in 1:3) {
same_cell <- cmbine[cmbine$classes == i, ]
if (nrow(same_cell)!=0){
for (j in 1:nrow(same_cell)){
picked <- same_cell[j, ]
assign(paste("df", j, sep=""), picked)
#assign(paste("df",j, sep=""), paste("df", j, sep=""))
}
}
Th...