updateFromDF: Update a rezrDF using data from another data frame

View source: R/io_csv.R

updateFromDFR Documentation

Update a rezrDF using data from another data frame

Description

Update a rezrDF using data from another data frame

Usage

updateFromDF(
  targetDF,
  changeDF,
  changeCols = NULL,
  changeType = "flex",
  renameCols = F,
  colCorr = list(),
  delRows = F,
  addRows = F,
  addCols = F,
  reloadAfterCorr = T,
  rezrObj = NULL
)

Arguments

targetDF

The target rezrDF.

changeDF

A data frame, not necessarily a rezrDF, from which changes will be pulled.

changeCols

Columns to be changed. This should include names of columns to be added.

changeType

Which types of columns (in field access terms) will you change?

renameCols

Will you rename columns according to the new data frame?

colCorr

If renameCols = T, then a list where names are the new names and values are the old names. If renameCols = F, then the opposite.

delRows

Will you delete rows from targetDF if not present in changeDF?

addRows

Will you add rows to targetDF if not present in targetDF?

addCols

Will you add columns present in the changeDF but not in the targetDF?

reloadAfterCorr

Would you like to do a local reload on the rezrDF afterwards (if a rezrObj is not supplied) or a full reload (if a rezrObj is supplied)?

rezrObj

The rezrObj, if you would like to do a full reload.

Value

The updated rezrDF.

Note

Most often used for updating a rezrDF using data from a CSV used for manual annotation.

Examples

inpath = system.file("extdata", "rez007_refexpr_edited.csv", package = "rezonateR")
changeDF = rez_read_csv(inpath, origDF = rez007$trackDF$default)
sbc007$trackDF$default = sbc007$trackDF$default %>% updateFromDF(changeDF, addCols = T)

johnwdubois/rezonateR documentation built on Nov. 19, 2024, 11:17 p.m.