as.data.frame.ldtv: Convert Variable to Data Frame

View source: R/variable.R

as.data.frame.ldtvR Documentation

Convert Variable to Data Frame

Description

Use this function to convert a variable to a data frame. You can use the result for plotting.

Usage

## S3 method for class 'ldtv'
as.data.frame(x, ...)

Arguments

x

An ldtv object.

...

Additional arguments.

Value

A data frame in which row names are set from the frequency of the variable.

Examples

# Define the variable:
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)

# convert it to data.frame
df1 <- as.data.frame(v1)


tdata documentation built on Nov. 7, 2023, 5:07 p.m.