check: Check for an Original MCMC File

checkR Documentation

Check for an Original MCMC File

Description

Checks whether or not a file is identical to the one used to create an object.

Usage

is_original(object, ...)

## S4 method for signature 'MCMC'
is_original(object, file, download = FALSE)

## S4 method for signature 'PhasesMCMC'
is_original(object, file, download = FALSE)

## S4 method for signature 'CumulativeEvents'
is_original(object, file, download = FALSE)

## S4 method for signature 'ActivityEvents'
is_original(object, file, download = FALSE)

## S4 method for signature 'OccurrenceEvents'
is_original(object, file, download = FALSE)

Arguments

object

An object (typically an MCMC object).

...

Currently not used.

file

Either a path to a CSV file or a connection.

download

A logical scalar: should the remote file be downloaded and hashed locally?

Value

A logical: TRUE if the files match, FALSE otherwise.

Author(s)

T. S. Dye, N. Frerebeau

See Also

digest::digest()

Other read methods: as_coda(), as_events(), as_phases(), read_bcal(), read_chronomodel, read_oxcal()

Examples

## Not run: 
## Import OxCal Output
path_output <- system.file("oxcal/ksarakil/MCMC_Sample.csv", package = "ArchaeoData")
url_output <- paste0("https://raw.githubusercontent.com/ArchaeoStat/ArchaeoData/master/",
                     "inst/oxcal/ksarakil/MCMC_Sample.csv")

oxcal <- read_oxcal(path_output)

## Check md5 sum
is_original(oxcal, path_output) # Same as local file? TRUE
is_original(oxcal, url_output, download = FALSE) # Same as remote file? FALSE
is_original(oxcal, url_output, download = TRUE) # Same as remote file? TRUE

## End(Not run)

ArchaeoPhases documentation built on June 22, 2024, 9:24 a.m.