View source: R/ff_fill_table.R
fill_table | R Documentation |
NA_*
Automatically finds non recorded date periods and fills
them with NA_real_
values.
fill_table(x, col_name = "all", by = NULL)
x |
data frame (or tibble) with class |
col_name |
string with column(s) name(s) to fill. |
by |
string with a valid time step (e.g.: |
A data frame (or tibble) with the date and the filled numeric variable(s).
# let's use a synthetic example to illustrate the use of the function
dates <- seq.Date(from = as.Date('1980-01-01'),
to = as.Date('2020-01-01'), by = 'day' )
var <- runif(n = length(dates), min = 0, max = 100)
met_var <- data.frame(date = dates, random = var)[-c(50:100, 251, 38) , ]
met_var_fill <- fill_table(x = met_var, by = 'day')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.