I have a long data format:
Row Conc group 1 2.5 A 2 3.0 A 3 4.6 B 4 5.0 B 5 3.2 C 6 4.2 C 7 5.3 D 8 3.4 D
...
Actual data has hundreds of rows. I would like to split A into C and D. I looked on the Internet and found some solutions, but not applicable to my case.
How to split a data frame?
For example: Case 1:
x = data.frame(num = 1:26, let = letters, LET = LETTERS) set.seed(10) split(x, sample(rep(1:2, 13)))
I do not want to break into an arbitrary number
Case 2: Divide by Level / Ratio
data2 <- data[data$sum_points == 2500, ]
I also do not want to share one factor. Sometimes I want to combine many levels.
Case 3: selection by line number
newdf <- mydf[1:3,]
Actual data contains hundreds of rows. I do not know the line number. I just know the level that I would like to break.
source share