Description Usage Arguments Value Author(s) Examples
Diferent scores of Mediterranean Diet set cutoffs of daily, weekly or monthly consumption. Additionally, a dataset can be stored as diferent frequency of consumption. This function has been created to be called by others, it just multiplies or divides by the suitable numbre (for instance, from 'daily' to 'weekly' it just multiplies by 7)
1 | periodicity(x, OriginalFreq, TargetFreq)
|
x |
numeric variable or a list of numeric variables, which want to be converted |
OriginalFreq |
character string. The frequency in which information was captured (should be provided by user). Allowed values are 'daily', 'weekly' or 'monthly' |
TargetFreq |
character string. The frequency in which information has to be transformed. Allowed values are 'daily', 'weekly' or 'monthly'. Usually it will be provided by another formula, depending in its scoring scheme |
A numeric vector, or a list of numeric vectors.
Miguel Menendez
1 2 3 4 5 6 7 8 9 | foodA <- c(1,2,3)
foodB <- c(3,2,1)
L <- list(foodA = foodA, foodB= foodB)
# Use with a numeric variable
periodicity(foodA, "daily", "weekly")
#Use with a list
periodicity(L, "daily", "weekly")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.