rg_class_compatibility: Convert classes of Rgadget and gadgetSim objects to be...

Description Usage Arguments Value Examples

Description

Much care has been taken in an attempt to keep gadgetSim and Rgadget as compatible as possible, but Rgadget uses slightly different syntax for creating classes of objects that gadgetSim. These functions alter classes appropriately allowing for greater compatibility between the two packages allowing for (hopefully) seamless integration.

Usage

1
2
3
gs2rg_classes(gs_obj)

rg2gs_classes(rg_obj)

Arguments

gs_obj

An object created or read by gadgetSim (i.e. should be of class gadget_* (i.e. gadget_main, gadget_likelihood, etc))

rg_obj

An object created or read by Rgadget (i.e. likely will be of class gadget.* (i.e. gadget.main, gadget.printfile, etc))

Value

The same gs_obj, but with a class appropriate for use in Rgadget

Examples

1
2
3
4
5
6
7
8
# converting from gadgetSim to Rgadget
path <- system.file(gad_mod_dir, package = "gadgetSim")
gs_main <- read_gadget_main(path = path)
gs2rg_classes(gs_main)

# converting classes from Rgadget to gadgetSim
rg_main <- Rgadget::read.gadget.main(paste(path, "main", sep = "/"))
rg2gs_classes(rg_main)

inspktrgadget/gadgetSim documentation built on May 10, 2019, 9:51 a.m.