copy.Rd
In `mudim` parkage, all objects (distributions, models) refered by *reference*. That is, if a variable is assigned to an other one, no copy is made at all. Both new variables refer to the same object.
copy(x) # S3 method for Model copy(x)
x | Distribution, Compositional model |
---|
Returns a copy of the object
`mudim` provides functions and that operate on objects *by reference* and minimize full object copies as much as possible. Still, it might be necessary in some situations to work on an object's copy which can be done using `d.copy <- copy(d)`. Assume command `d.copy <- d`. Due to R's *copy-on-modify* policy, `d.copy` still points to the same location in memory as `d`. Therefore modifying `d.copy`, say by changing variables names, `d` will also get updated. To avoid this, one has to *explicitly* copy: `d.copy <- copy(d)`.
Model
: Copy compositonal model
#> [1] "A" "B"#> [1] "C" "D"#> [1] "C" "D"