I am trying to move from this:
name = c("tom", "tom", "tom", "chris", "chris", "chris", "jen", "jen", "jen")
value = c(2,10,"end",45,"end",13,6,"end",13)
df = data.frame(name,value)
or this (which uses NA as a cutoff)
name = c("tom", "tom", "tom", "chris", "chris", "chris", "jen", "jen", "jen")
value = c(2,10,NA,45,NA,13,6,NA,13)
starting_df = data.frame(name,value)
For this:
name = c("tom", "tom", "tom", "chris", "chris", "chris", "jen", "jen", "jen")
value = c(12,12,12,45,45,45,6,6,6)
ending_df = data.frame(name,value)
The idea here is to summarize by group (name in this case), which I can easily use with the function group_by
from dplyr
, but I need to delete all the values below NAs
or the text that reads end
. Values below these cutoffs cannot be included in my amount. I have been working on this all night and I'm not up to date. Thank you for your help.