createCalculated {exceldata}R Documentation

Create calculated variables

Description

This function will create survival and recoded variables according to the rules in the dictionary.xlsm file. See the Example sheet for an example.

Usage

createCalculated(data, dictionary, timeUnit = "month")

Arguments

data

A data frame data returned by the importExcelData or readExcelData functions

dictionary

A data frame returned by the importExcelData or readDataDict functions

timeUnit

String containing the desired unit of time for survival variables

Value

A data frame with the calculated variables as specified by the dictionary

Examples

## Not run: 
exampleDataFile <- system.file("extdata", "exampleData.xlsx", package = "exceldata")
dictionary <- readDataDict(exampleDataFile, dictionarySheet = 'DataDictionary')
data <- readExcelData(exampleDataFile,dictionary,dataSheet='DataEntry')
factorData <- addFactorVariables(data,dictionary,keepOriginal = TRUE)
fullData <- createCalculated(factorData,dictionary,timeUnit='month')

## End(Not run)

[Package exceldata version 0.1.1.3 Index]