rep.ParameterSet: Replicate a ParameterSet

View source: R/ParameterSet_S3methods.R

rep.ParameterSetR Documentation

Replicate a ParameterSet

Description

In contrast to the $rep method in ParameterSet, this method deep clones the ParameterSet and returns a new object.

Usage

## S3 method for class 'ParameterSet'
rep(x, times, prefix, ...)

Arguments

x

(ParameterSet)

times

(integer(1))
Numer of times to replicate the ParameterSet.

prefix

(character(1)|character(length(times)))
The prefix to add to ids and linked tags. If length 1 then is internally coerced to paste0(prefix, seq(times)), otherwise the length should be equal to times.

...

(ANY)
Other arguments, currently unused.

Details

In order to avoid duplicated parameter ids, every id in the ParameterSet is given a prefix in the format prefix__id. In addition, linked tags are also given the same prefix to prevent incorrectly linking parameters.

The primary use-case of this method is to treat the ParameterSet as a collection of identical ParameterSet objects.


param6 documentation built on March 18, 2022, 6:13 p.m.