c.record: Concatenate Records

Description Usage Arguments Details Value See Also Examples

View source: R/record.R

Description

Create a new record by concatenating values together.

Usage

1
2
## S3 method for class 'record'
c(...)

Arguments

...

values to concatenate.

Details

The c.record function converts its non-NULL arguments to records with as.record, then forms a new record by concatenating the records together.

Named arguments get their field names qualified with the specified argument name, separated by a period (.).

Calling the c generic function with a record as the first argument will dispatch to c.record. We export the c.record function explicitly to enable control over the dispatch with arbitrary argument types.

Value

A record gotten by concatenating the non-NULL argument fields together, or NULL if no arguments are nonNULL.

See Also

record, cbind.dataset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
x <- record(a = 1, b = "two")
y <- 3
z <- list(d = FALSE)

# record as first argument
c.record(x, y, z) # explicit dispatch
c(x, y, z)        # implicit dispatch (same result)

# non-record as first argument
c.record(z, y, x) # explicit dispatch
c(z, y, x)        # implicit dispatch (different result)

# named arguments
c.record(xx = x, yy = y, zz = z)

patperry/r-frame documentation built on May 6, 2019, 8:34 p.m.