variable {tdata}R Documentation

Create a Variable

Description

Use this function to create a variable, which is a data array with frequencies. It can have a name and other named fields.

Usage

variable(data, startFrequency = NULL, name = NULL, fields = NULL)

Arguments

data

The data of the variable.

startFrequency

The frequency of the first element.

name

The name of the variable.

fields

A list that contains named fields.

Value

An object of class ldtv, which is also a list with the following members:

Examples

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)

[Package tdata version 0.3.0 Index]