AddHistory: Amend the history of a proxy object

Description Usage Arguments Value Author(s) Source See Also Examples

View source: R/small-methods.R

Description

This function amends the history information of a "pTs" or "pField" object by adding a given character string (e.g., a comment) to the "history" attribute of the object together with the date information of this action.

Usage

1
AddHistory(x, newhist, date = TRUE)

Arguments

x

a "pTs" or "pField" object.

newhist

character string with the history information to be added.

date

logical, whether or not to append the current date to the history attribute; defaults to TRUE.

Value

the "pTs" or "pField" object with the amended history.

Author(s)

Thomas Laepple

Source

Function copied from "basis.R" in paleolibary/src/.

See Also

Other history: GetHistory()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Create empty pTs object:
x <- pTs(lat = -75, lon = 0, time = 1,
         history = sprintf("Object created."))

# Check history
GetHistory(x)

# Some changes made
x <- AddHistory(x, newhist = "Changed xyz.")

# Check new history
GetHistory(x)

EarthSystemDiagnostics/pfields documentation built on Jan. 10, 2022, 10:37 p.m.