myformat.data: Format data based on pre-defined information

View source: R/formating.R

myformat.dataR Documentation

Format data based on pre-defined information

Description

A function to format each variable in data frame based on pre-defined information.

Usage

myformat.data(data, info)

Arguments

data

a data frame contains variables to be formatted

info

a data frame specifies how variables will be formatted. This data frame should have the following columns: varname (character variable specifies name of each variable), label (character variable specifies label of each variables), type (character variable specifies type of each variable [numeric, factor, character, datetime], unit (character variable specifies units of each continuous variable), value (character variable specifies values of each variable [format of datetime variables/values of categorical variables], levels (character variable specifies order of levels of each categorical variable), missing (character variable specifies coding for missing values for each variable).

Value

a data frame with variables are formatted according information specified in info


oucru-biostats/C306 documentation built on July 16, 2024, 2:33 p.m.