update_intracker: Update input tracker status

Description Usage Arguments Value Examples

View source: R/Status_Trackers.R

Description

Update input tracker status

Usage

1
2
3
4
5
6
7
update_intracker(
  ist,
  tracker,
  prepared = NULL,
  checked = NULL,
  clean_subsequent = FALSE
)

Arguments

ist

A data.frame representing an input tracker as generated by function init_intracker.

tracker

A character string. One of the rownames of ist.

prepared

A logical value or NULL. If not NULL, then the requested tracker will be updated with this value and its time stamp set.

checked

A logical value or NULL. If not NULL, then the requested tracker will be updated with this value and its time stamp set.

clean_subsequent

A logical value. If TRUE then trackers in rows greater than tracker will be reset to FALSE.

Value

The updated data.frame ist.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 # Create a new tracker object: if using 'demo' code to run a project,
 # then the object 'SFSW2_prj_meta' will contain a tracker object with
 # name 'input_status'
 SFSW2_prj_meta <- list(input_status = rSFSW2:::init_intracker())

 # Update the 'soil_data' trackers to indicate that data extraction has
 # already been carried out (e.g., soil data were entered separately)
 SFSW2_prj_meta[['input_status']] <- update_intracker(
   SFSW2_prj_meta[['input_status']], tracker = "soil_data", prepared = TRUE)

 # Reset the 'dbW_scenarios' trackers to so that both data
 # population/extraction and checking steps are carried out again during
 # the next run
 SFSW2_prj_meta[['input_status']] <- update_intracker(
   SFSW2_prj_meta[['input_status']], tracker = "dbW_scenarios",
   prepared = FALSE, checked = FALSE)

 # Save updated metadata with tracker object to project directory to prepare
 # for next run
 SFSW2_prj_meta[["fnames_in"]] <- list(fmeta = tempfile())
 saveRDS(SFSW2_prj_meta, file = SFSW2_prj_meta[["fnames_in"]][["fmeta"]])

 #Clean up from example
 unlink(SFSW2_prj_meta[["fnames_in"]][["fmeta"]])

DrylandEcology/rSFSW2 documentation built on Aug. 18, 2020, 1:27 p.m.