renormalize: renormalize

Description Usage Arguments Value

Description

renormalize a denormalized list into a Boyce-Codd style data frame suitable for relational databases.

Usage

1
2
3
4
5
6
7
8
renormalize(
  x,
  idcol,
  listcol,
  sep = ",",
  listcolname = "normalized",
  na.replace = ""
)

Arguments

x

a datafame to analyze

idcol

a string describing the column name holding ids or the numeric value of the column's index

listcol

a string describing the column name holding the values to be re-normalized or the numeric value of the column's index. Note that listcol data will be coerced to a string. NA values and values which do not coerce properly will be replaced with empty strings.

sep

a string describing the seperator between values in listcol. Defaults to ",".

listcolname

the name of the new column of re-normalized values. Defaults to 'normalized'.

na.replace

a string to use in place of NA values of x. Defaults to a blank string.

Value

returns a 2-column data frame. The first column is a vector of ids from the original data frame. The second column is the renormalized data. Rows from x where listcol is NA are removed.


crazybilly/muadc documentation built on March 6, 2021, 4:15 p.m.