CreateTimeSeriesDf: Convert Repeated Element into Long Format Data Frame

Description Arguments Examples

Description

the NLSdata package provides the function CreateTimeSeriesDf to coerce a portion of the data frame into a long format. Under the hood, it's using the reshape2's melt function.

Arguments

obj

an NLSdata object

variable.base

character string common prefix for the repeated element

Examples

1
2
3
4
5
6
7
8
library(NLSdata)
codebook <- system.file("Investigator", "Religion.cdb", package = "NLSdata")
csv.extract <- system.file("Investigator", "Religion.csv", package = "NLSdata")

nls.obj <- CreateNLSdata(codebook, csv.extract)

religion.df <- CreateTimeSeriesDf(nls.obj, "YSAQ_282A2")
head(religion.df[order(religion.df$PUBID.1997), ])

google/NLSdata documentation built on May 17, 2019, 7:43 a.m.