subset: Subsetting

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

Description

Methods for subsetting using [,] and subset for process data objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## S4 method for signature 'ProcessData'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'ContinuousProcess'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'MarkedPointProcess'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'JumpProcess'
x[i, j, ..., drop = FALSE]

## S4 method for signature 'ProcessData'
subset(x, subset, select, ...)

## S4 method for signature 'ContinuousProcess'
subset(x, subset, select, ...)

## S4 method for signature 'MarkedPointProcess'
subset(x, ..., pointSubset)

## S4 method for signature 'JumpProcess'
subset(x, subset, select, ...)

## S4 method for signature 'ProcessData'
unsubset(x, ...)

## S4 method for signature 'ContinuousProcess'
unsubset(x, ...)

## S4 method for signature 'MarkedPointProcess'
unsubset(x, ...)

Arguments

x

a process object.

i

a numeric, logical or character.

j

a numeric, logical or character.

drop

a logical. Detault value FALSE.

subset

an expression given in terms of the variables in the data set that evaluates to logical. See details for further explanations.

select

an expression that evaluates to logical in a frame consisting of the column names.

pointSubset

an expression given in terms of the mark value variables in the data set that evaluates to logical. The argument must be named.

...

other arguments. In particular, the subset method for MarkedPointProcess takes the two arguments subset and select and passes them to the ContinuousProcess method.

Details

Bracket subsetting works basically as if the process data was a big data frame with variable names as the column names. All subsetting is, however, done by reference meaning that the data is not copied but pointers to the subset are computed.

The subset method works in the same ways as the subset function for data frames, but relying on the reference based bracket subsetting. This allows for an unsubset method that brings the full data set back from a subset.

Value

A process object of the same class as x unless drop = TRUE. If drop = TRUE the object is dropped to a class further down the class hierarchy if appropriate. For instance, subsetting to column entries for a MarkedPointProcess such that all mark columns are lost results in an object of class ContinuousProcess if drop = TRUE.

Author(s)

Niels Richard Hansen, Niels.R.Hansen@math.ku.dk

See Also

ContinuousProcess, MarkedPointProcess, JumpProcess, subset, [

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(example)
contExam[1:1500, ]
subset(pointExam, time > 4 & gender == "M")

contExam[ ,2:3]

colNames(pointExam)
pointExam[ , c("gender", "foo", "ALPHA")]
pointExam[ , c("gender", "foo"), drop = TRUE]
subset(pointExam, select = gender:BETA)

processdata documentation built on May 2, 2019, 5:23 p.m.