Given this dataframe
row | time | name
-----------------
1 | 2 min| bob
2 | 7 min| john
3 | 1 hr 5 min| jess
I want to process the time column to a numeric column that holds the number of minutes. I have a function to process the string into a number, but when I try to apply
it to mutate/transform the original data frame, data.frame(apply(dataframe, 2, parse_str))
, it crashes or just doesn't work. Once I can get the transformation function applied, I plan on converting the character column to numeric via df = as.numeric(as.character(dataframe$time))
, but haven't tested it yet.
Any ideas on how I can get my preprocessing function to correctly mutate/transform/create a new dataframe?