I have this data set that I am trying to convert in order to get the "from" and "to" positions within a specific grouping of data points that pass the test.
Here's what the data looks like:
pos <- seq(from = 10, to = 100, by = 10) test <- c(1, 1, 1, 0, 0, 0, 1, 1, 1, 0) df <- data.frame(pos, test)
So, you can see that positions 10, 20 and 30, as well as 70, 80 and 90 pass the test (b / c test = 1), but the rest of the points do not. The answer I'm looking for will be a data frame that looks something like a โresponse data frameโ in the code below:
peaknum <- c(1, 2) from <- c(10, 70) to <- c(30, 90) answer <- data.frame(peaknum, from, to)
Any suggestions on how I can convert the dataset? I'm at a dead end.
Thanks Steve
source share