MDassign: Assign Value to metaDAT List

Description Usage Arguments Value Examples

Description

Assign value(s) to a new or existing MDlist variable

Usage

1
  MDassign(meta.obj, var, values, NA2NULL = TRUE)

Arguments

meta.obj

An MDlist (an object from read.MD).

var

A length one character vector of the variable name to assign to.

values

A vector of value(s) to assign to var.

NA2NULL

logical. If TRUE converts missing (NA) to NULL.

Value

Returns a MDlist object with the newly assigned values.

Examples

1
2
3
4
5
6
7
8
9
path <- system.file("extdata/bibTest.bib", package = "metaDAT")
dat <- read.MD(path)
MDassign(dat, "new", rnorm(3))
MDassign(dat, "nt", rnorm(3))
MDassign(dat, "new", list(1, 2, 3))
MDassign(dat, "new", list(1, 2, NULL))
MDassign(dat, "new", c(1, 2, NA))
MDassign(dat, "new", c(1, 2, NA), NA2NULL = FALSE)
MDassign(dat, "new", list(NA, mtcars[, 1], mtcars))

trinker/metaDAT documentation built on May 31, 2019, 8:52 p.m.