replaceHeaderNamesWithLabels: Get a new dataframe, where the header contains the full...

Description Usage Arguments Value Examples

View source: R/formhub.R

Description

formhub Objects have some data, as well as the form, which documents how the data was obtained through a survey. The data, by default, is represented by slugs, ie, items in the 'name' column in the original xfrom. This function replaces slugs in the header with the actual question text.

Usage

1

Arguments

formhubDataObj

is the formhub data object whose data slot will be renamed

Value

a new data frame with the column names renamed from 'name's (slugs) to 'label's(full questions)

Examples

1
2
3
4
5
6
good_eats <- formhubDownload("good_eats", "mberg")
names(good_eats) # still slugged names
summary(good_eats$rating)
full_header_good_eats <- replaceHeaderNamesWithLabels(good_eats)
names(full_header_good_eats) # not slugged anymore
summary(full_header_good_eats$Rating) # but data is the same

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