RM_add: Create a results managment or add a value in a results...

View source: R/RM_add.R

RM_addR Documentation

Create a results managment or add a value in a results managment to an object

Description

Return original object with a new value or a new results managment.

Usage

RM_add(
  x = stop("An object with results managment must be provided"),
  RM = "RM",
  RMname = stop("A results managment name must be provided"),
  valuename = NULL,
  value = NULL
)

Arguments

x

The object to add a results managment or a result in a results managment

RM

The name of results managment stored

RMname

The name of the results managment to be modified or created

valuename

The name of the new value to be added

value

The value to be added

Details

RM_add adds a results managment or a value in results managment to an object

Value

The original object with a new value in a results managment object or a new results managment

Author(s)

Marc Girondot marc.girondot@gmail.com

See Also

Other Results Managment: RM_delete(), RM_duplicate(), RM_get(), RM_list()

Examples

## Not run: 
library("HelpersMG")
# Let an object of class objclass being created
obj <- list(A=100, name="My object")
class(obj) <- "objclass"
# And now I create a RM to this object
obj <- RM_add(x=obj, RMname="NewAnalysis1")
RM_list(obj)
obj <- RM_add(x=obj, RMname="NewAnalysis2")
RM_list(obj)
obj <- RM_add(x=obj, RMname="NewAnalysis2", valuename="V1", value=100)
RM_get(x=obj, RMname="NewAnalysis2", valuename="V1")
obj <- RM_add(x=obj, RMname="NewAnalysis2", valuename="V1", value=200)
RM_get(x=obj, RMname="NewAnalysis2", valuename="V1")
obj <- RM_add(x=obj, RMname="NewAnalysis2", valuename="V2", value=300)
RM_get(x=obj, RMname="NewAnalysis2", valuename="V2")
RM_list(obj)

## End(Not run)

HelpersMG documentation built on Sept. 12, 2024, 9:35 a.m.