find_timecol | R Documentation |
This function takes a data frame as argument and returns the column names (or indices) of all columns containing dates and the most likely column containing year information, if any. It can be used to automate the search of date and year columns in data frames.
find_timecol(x, return_index = FALSE, allow_NA = TRUE, sample_size = 1000)
x |
A data frame object |
return_index |
A logical value indicating whether the function should return the index of time columns instead of the column names. Default is |
allow_NA |
Logical value indicating whether to allow time columns to contain |
sample_size |
Either |
Returns a vector of names (return_index=FALSE
) or indices (return_index=TRUE
) of columns containing date or year information. Only the most likely year column is returned.
is_date, find_countrycol
find_timecol(x=data.frame(a=1970:2020, year=1970:2020, b=rep("2020-01-01",51),c=sample(1:1000,51)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.