formhubCast: Casts a dataframe to the right types based on a...

Description Usage Arguments Value Examples

View source: R/formhub.R

Description

This function creates a formhubData object based on a pair of dataframes: the data and the form that describes the data. The column names of the data match with the "name" column of the form, and the "type" column in the form provide information for type conversion.

Usage

1
2
formhubCast(dataDF, formDF, extraFormDF = data.frame(), dropCols = "",
  convert.dates = TRUE)

Arguments

dataDF

data

formDF

form data frame. See format above.

extraFormDF

override the form (such as by providing a type for a calculate, a new label, etc.)

dropCols

a regular expression, any column name that matches that regexp will be dropped

Value

formhubDataObj a formhubData Object, with "data" and "form" slots

Examples

1
#See examples under formhubRead; this should be used through formhubRead in almost all cases

prabhasp/formhub.R documentation built on May 25, 2019, 11:25 a.m.