Description Usage Arguments Value Examples
Make Columns As Factor
1 2 3 4 5 6 7 | factor_dims(
dataset,
...,
funcs = list(),
quarter_readable = TRUE,
quarter_trans = antgreens::quarter_readable
)
|
dataset |
data frame with readable |
... |
dimensions to be made as factor. |
funcs |
named list of custome factor function |
quarter_readable |
logical, default |
quarter_trans |
list containing 4 characters and the names of each element is 1, 2, 3, 4, which represents the four quarters. |
data frame with factor column. And the order of quarter is
depends on the order of quarter_readable
; the order of year is depends on
the number of year; the order of province, category product and drug are depends
on the dictionary order of character.
1 2 | data <- data.frame(year = 2016:2019, quarter = c(1,2,3,4))
factor_dims(data, year, quarter, quarter_trans = list(`1`='a',`2`='b',`3`='c',`4`='d'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.