Convert a data frame with timestamps into a list of circular objects
Convert a data frame with timestamps into a list of circular objects
timesToCircular(x, by.group = FALSE)
x |
A data frame where the first column is an identifier, the second column
is a grouping structure, and columns three and onwards are timestamps at different
locations. Can be generated automatically by |
by.group |
Logical: Should the times at each location be divided by the group column (second column of x)? |
A list of circular objects for each data column and, optionally, for each group.
# create dummy input data frame. # Note: the names of the columns are irrelevant. x <- data.frame(ID = c(1:5), Group = c("A", "A", "B", "B", "B"), A1 = as.POSIXct( c("2019-01-03 11:21:12", "2019-01-04 12:22:21", "2019-01-05 13:31:34", "2019-01-06 14:32:43", "2019-01-07 15:23:52")), A2 = as.POSIXct( c("2019-01-08 16:51:55", "2019-01-09 17:42:42", "2019-01-10 18:33:33", "2019-01-11 19:24:32", "2019-01-12 20:15:22")), stringsAsFactors = TRUE) # run timesToCircular timesToCircular(x) # optionally, split results by group: timesToCircular(x, by.group = TRUE)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.