gadget_directory: Gadget directory objects

Description Usage Arguments Details Examples

Description

Structures representing a directory of data files

Usage

1
2
3
gadget_directory(dir, mainfile = "main")
gadget_dir_write(gd, obj)
gadget_dir_read(gd, file_name, missing_okay = TRUE)

Arguments

dir

Name of directory, will be created if it doesn't exist.

mainfile

Name of the GADGET mainfile to use.

gd

A gadget_directory object.

obj

The gadget_file, or gadget_likelihood_component to write.

file_name

File to read out of the directory and turn into a gadget_file.

missing_okay

If true, return an empty file instead of complaining that the given file does not exist.

Details

This handles

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 
# Create a gadget directory
gd <- gadget_directory('./out')

# Read in the likelihood file
likelihood <- gadget_dir_read(gd, 'likelihood')

# Write out an area file to "./out/areas", replacing any existing file
gadget_dir_write(gd, gadget_file("areas", components = list(list(north = 1:3, south = 4:7))))

# Replace a likelihood component if one already exists with
# the same name/type or append it to the bottom
gadget_dir_write(gd, gadget_likelihood_component("understocking", name = "frank"))

## End(Not run)

sCervino/mfdb documentation built on May 18, 2019, 1:31 p.m.