Nothing
#'Get cumulative count
#'
#'Get the cumulative count of a variable of interest
#'@param x A vector for which to get cumulative count
#'@return The cumulative count of all items in x
#'@export
cumcount <- function(x){
cumcount <- numeric(length(x))
names(cumcount) <- x
for(i in 1:length(x)){
cumcount[i] <- sum(x[1:i]==x[i])
}
return(cumcount)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.