#'reorder data by individual ID and timestamp
#'
#'@param x a data frame
#'@param y individual local identifier column
#'@param z timestamp column
#'@return product of reordered data frame
#'@export
data_ordered <- function(x, y, by_col){
x <- x %>%
rename(ID = {{y}}) %>%
rename(sortkey = {{by_col}})
product <- x[with(x, order(ID, sortkey)),]
if(is.data.frame(product) == FALSE){
return("ERROR - non data frame")
}
return(product)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.