Skip to contents

Given TidySet retrieve the elements or substitute them.

Usage

elements(object)

elements(object) <- value

# S4 method for class 'TidySet'
elements(object)

# S4 method for class 'TidySet'
elements(object) <- value

replace_elements(object, value)

# S4 method for class 'TidySet,missing'
nElements(object)

# S4 method for class 'TidySet,logical'
nElements(object, all)

Arguments

object

A TidySet object.

value

Modification of the elements.

all

A logical value to count all elements or just those present.

Value

A data.frame with information about the elements

Methods (by class)

  • elements(TidySet): Retrieve the elements

  • elements(TidySet) <- value: Modify the elements

  • nElements(object = TidySet, all = missing): Return the number of elements

  • nElements(object = TidySet, all = logical): Return the number of elements

Examples

TS <- tidySet(list(A = letters[1:5], B = letters[2:10]))
elements(TS)
#>    elements
#> 1         a
#> 2         b
#> 3         c
#> 4         d
#> 5         e
#> 6         f
#> 7         g
#> 8         h
#> 9         i
#> 10        j
elements(TS) <- data.frame(elements = letters[10:1])
TS2 <- replace_elements(TS, data.frame(elements = letters[1:11]))
nElements(TS)
#> [1] 10
nElements(TS2)
#> [1] 11