scoop {scope}R Documentation

Look Up Column Values for Rows In Scope

Description

For each vector of row.names in scope, scoop() will try to retrieve a value from the specified column. If the vector contains exactly one row.name, the corresponding value will be returned. Otherwise, NA is returned. If scope is not specified, the specified column is returned.

Usage

scoop(x, this, scope = NULL, ...)

Arguments

x A data frame.
this A column name in x, from which values are taken.
scope A scope object, ideally all elements atomic.
... extra arguments, currently unused.

Value

A vector of same length as the data frame columns, and same mode as this.

See Also

scope, score, skim, probe,

Examples

data(Theoph)
#Consider earliest row for each Subject, and return 'conc'.
S <- scope(Theoph,'Subject')
S2 <-scope(Theoph,'Time',that=0,scope=S)
any(score(S2)!=1)
scoop(Theoph,'conc',scope=S2)

[Package scope version 2.2 Index]