Create a subset of a constraints object:

  • constraints[i]

  • subsetConstraints(constraints, 1:10)

Combine two constraints objects:

  • c(constraints1, constraints2)

  • combineConstraints(constraints1, constraints2)

subsetConstraints(x, i = NULL)

combineConstraints(x1, x2)

# S4 method for class 'constraints,numeric'
x[i, j, ..., drop = TRUE]

# S4 method for class 'constraints'
c(x, ...)

Arguments

x, x1, x2

a constraints object.

i, j

indices to use in subsetting.

...

not used, exists for compatibility.

drop

not used, exists for compatibility.

Examples

c1 <- constraints_science
c2 <- c1[1:10]
c3 <- c1[c(1, 11:36)] # keep constraint 1 for test length
c4 <- c(c2, c3)
#> Warning: duplicate constraint IDs were removed: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10