patch: Patches holes in a data set by using group means and...

Description Usage Arguments Value Examples

View source: R/scraper.R

Description

Biological data is only rarely complete, however k-cone analysis requires fully populated steady state concentration data. This functions helps to patch holes in your data. It assumes that the measurements data set is a data frame where the id column uses a shared identifier as the reference data set and the data columns specifify control and treatment measurements. The optional reference data set is further used to fill up holes which cannot be patched by group means.

Usage

1
patch(measurements, id, normal, treatment, ref_data = NULL)

Arguments

measurements

A data frame with one id column, and at least one normal and one treatment column

id

An index or column name specifying the ids

normal

A vector of indices or column names specifying the control group

treatment

A vector of indices or column names specifying the treatment group

ref_data

An optional data frame of reference data 2 or 3 columns, where the first column denotes the ids, the second the normal reference data and the (optional) third column the treatment reference data.

Value

The original measurement data frame with a maximum number of missing data being patched.

Examples

1
2
x <- data.frame(id = 1:3, normal = c(NA, 1, 2), disease = c(2, NA, 3))
patch(x, 1, 2, 3)

cdiener/dycone documentation built on Sept. 9, 2018, 1:20 p.m.