Super new to R - like, started yesterday new. I'm trying to group and sort a data set and it seems as though samples like:
aggdata <- aggregate(mtcars, by = list(cyl, vs), FUN = mean, na.rm = TRUE)
Only work with numeric data. I've also tried working off this example: R Dataframe: aggregating strings within column, across rows, by group to build something new for my purpose but it's not giving me the output I need.
For the example, I have a data set that would look like:
Name DateTime
Jan 2017-05-26T12:38:50.537
Tim 2017-05-23T11:52:40.423
Rob 2017-05-24T10:52:40.423
Jan 2017-05-25T10:38:50.537
Tim 2017-05-19T11:52:40.423
Rob 2017-05-19T11:52:40.423
Jan 2017-05-22T12:38:50.537
Tim 2017-05-23T11:52:40.423
Rob 2017-05-20T11:52:40.423
I would like to group the data by name then sort the groups by time so the end result would be:
Name DateTime
Jan 2017-05-22T12:38:50.537
Jan 2017-05-25T10:38:50.537
Jan 2017-05-26T12:38:50.537
Rob 2017-05-19T11:52:40.423
Rob 2017-05-20T11:52:40.423
Rob 2017-05-24T10:52:40.423
Tim 2017-05-19T11:52:40.423
Tim 2017-05-23T11:50:40.423
Tim 2017-05-23T11:52:40.423
After grouping is successful, this sample for datetime seems promising Ordering date/time in descending order in R
In any case, if someone in the know could point me in the direction of an example that groups by string or alphanumeric I'd greatly appreciate it.