powered by
Use this function to create a variable, which is a data array with frequencies. It can have a name and other named fields.
variable(data, startFrequency = NULL, name = NULL, fields = NULL)
An object of class ldtv, which is also a list with the following members:
ldtv
data: Determines the data.
data
name: Determines the name.
name
startFrequency: Determines the startFrequency.
startFrequency
fields: Determines the fields.
fields
The data of the variable.
The frequency of the first element.
The name of the variable.
A list that contains named fields.
data <- c(1,2,3,2,3,4,5) start_f <- f.monthly(2022,12) fields <- list(c("key1","value1"), c("key2", "value2")) v1 = variable(data, start_f, "V1", fields)
Run the code above in your browser using DataLab