expand: Expand Summarized Dichotomous Data for drsmooth

Description Usage Arguments Details Value Examples

Description

This function expands summarized dichotomous data for input into drsmooth.

Usage

1
2
3
4
5
expand(dosecolumn = "",
      targetcolumn = "",
      ncolumn = "",
      data = NA,
      outputfilename = "")

Arguments

dosecolumn

Character string, name of dose column to be tested.

targetcolumn

Character string, name of response column to be tested.

ncolumn

Character string, name of N column of total cases per dose.

data

Input dataframe.

outputfilename

Character string, name of .csv file to be written out.

Details

The input data frame to this function is expected to contain a numerical dose column, identified as 'dosecolumn,' a numerical outcome count column, identified as 'targetcolumn,' and a numerical N column with the total number of cases tested in the dose group, identified as 'ncolumn.' See drsmooth included data DIdata for an example. This function takes such a summarized dataframe and returns an expanded case-by-case replicate df, which is suitable as an input to the drsmooth function, with data_type = "dichotomous". If an outputfilename is provided, the resulting df is also written to the working directory.

Value

A dataframe is returned containing one row for each case in each dose. If an outputfilename is provided, the df is also written out in a .csv file. An expanded dataframe or file such as this one is appropriate as input to the drsmooth function when data_type = "dichotomous".

Examples

1
2
3
# Generates an expanded dataframe from the included data DIdata:
data(DIdata)
DIdata_expanded <- expand(dosecolumn = "Dose", targetcolumn = "Tumor", ncolumn = "n", data = DIdata)

drsmooth documentation built on May 1, 2019, 10:28 p.m.