makeCompItem: Create a 'compitem' object.

View source: R/makeCompItem.R

makeCompItemR Documentation

Create a compitem object.

Description

This function creates a compitem from a set of observations on items to be deemed control, or a recovered, items. For example, a set of elemental concentration measurements on a sample of glass fragments taken from a crime scene source such as a window.

Usage

makeCompItem(x, ...)

## S3 method for class 'formula'
makeCompItem(x, data = NULL, ...)

Arguments

x

a matrix or data.frame or a formula

...

other arguments that may be passed to the function.

data

if x is a formula, then the user must supply a data.frame containing the observations.

Value

an object of class compitem

Methods (by class)

  • makeCompItem(formula): Create a compitem object using a formula.

Author(s)

David Lucy and James Curran

Examples

# load Greg Zadora's glass data
data(glass)

# calculate a compitem object representing the control item
controlMeasurements = subset(glass, item == "s1", select = c(logKO, logCaO, logFeO))
control = makeCompItem(controlMeasurements)

# example using the formula interface
controlMeasurements = subset(glass, item == "s1")
control = makeCompItem(item ~ logKO + logCaO + logFeO, data = controlMeasurements)
 

comparison documentation built on Aug. 25, 2023, 5:14 p.m.