transform_data: Transform Daily and Intake Data In Five Different Data Sets

Description Usage Arguments Value Examples

View source: R/padis_specific_functions.R

Description

This function is very specific and takes as input only the two data frames daily and intake raw data. It will then return the five data sets, named 1. "par_data", 2. "psp_long", 3. "day_data", 4. "issue_long", 5. "selection_long")

Usage

1
2
transform_data(daily_data, intake_data, write_to = "workspace",
  overwrite = FALSE, folder = NULL)

Arguments

daily_data

The Daily Raw data

intake_data

The Raw Intake data

write_to

Where the results should be written to. Can either be "workspace" (default), "xlsx", or "csv". The last two write the resulting data frames into the working directory either as .xlsx-files or .csv-files

overwrite

Logical, should an existing data frame/object be overwritten? Default is to FALSE

folder

The folder in which the resulting data sets should be written. If no folder is specified, the current working directory (result of getwd()) is used

Value

The function returns the five different data sets in long format

Examples

1
2
3
4
5
## not run
# these examples work only with the correct data frames
data_dy <- read.csv("Raw Diary Selection Data.csv", sep = ";", stringsAsFactors = FALSE)
data_in <- xlsx::read.xlsx("Raw Intake Sample.xlsx", 1)
transform_data(data_dy, data_in)

kthorstmann/padis documentation built on May 24, 2019, 5:01 a.m.