checkCountsFormat: GammaModel::checkCountsFormat

Description Usage Arguments Details Value References Examples

View source: R/functions.R

Description

Helper function to check count data are in the required format

Usage

1

Arguments

counts

A one-row data.frame comprising integer counts, with column names in capital letters

Details

Performs a few basic checks to ensure the raw count data are formatted as required:

A one-row data frame comprising column names of age classes (or multi-classes) in capital letters from 'A'. For example, Payne's 1973 caprine age classes are 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', and 'I'. However, it is more likely that the raw counts will include some multi-class assignments, for example 'ABCD', 'A', 'AB', 'B', 'BC' etc. Order does not matter.

Row names are unconstrained. In the 'Neolithic' dataset provided, these specify the site codes.

Raw counts must by definition be integers.

Deviations from these formatting requirements are output as warnings.

Value

The string 'OK' is returned if no errors are found. Otherwise a string stating the number of errors.

References

Kill-off Patterns in Sheep and Goats: The Mandibles from Asvan Kale. Payne 1973.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
    # load the raw data counts for all ten Neolithic sites
    data(Neolithic)

    # select the 'TRA1' subset
    counts <- Neolithic['TRA1',]

    # eyeball data
    print(counts)

    # check format
    checkCountsFormat(counts)

    # change to a non-integer count
    mistake <- counts
    mistake[3] <- 2.5
    checkCountsFormat(mistake)
	

UCL/GammaModel documentation built on June 25, 2020, 5:38 a.m.