Clone a full Rxs project object

cloneRxsProject(x, silent = metabefor::opts$get("silent"))

Arguments

x

The full Rxs project object

silent

Whether to be chatty or silent

Value

The cloned object

Examples

### Load an example Rxs project
data('example_rxsProject_1', package="metabefor");
  
### Check whether in this object, value 'hi' exists:
example_rxsProject_1$rxsTrees$qurid_7h50rzpq$hi;
#> NULL

### (should be NULL)

### Try to make a copy 'the conventional way'
copy_rxsProject_1 <-
  example_rxsProject_1;
  
### Change something
copy_rxsProject_1$rxsTrees$qurid_7h50rzpq$hi <- "Hello";

### Check that worked
copy_rxsProject_1$rxsTrees$qurid_7h50rzpq$hi;
#> [1] "Hello"

### Show how magically stuff also changed in the
### original even though we didn't change anything
example_rxsProject_1$rxsTrees$qurid_7h50rzpq$hi;
#> [1] "Hello"

### Clone it instead
copy_rxsProject_1 <-
  metabefor::cloneRxsProject(example_rxsProject_1);
  
### Make the same change in the copy
copy_rxsProject_1$rxsTrees$qurid_7h50rzpq$hi <- "Goodbye";

### Show how the value in the original didn't change again
example_rxsProject_1$rxsTrees$qurid_7h50rzpq$hi;
#> [1] "Hello"