Rsubset: Rsubset

RsubsetR Documentation

Rsubset

Description

Construct subset data.frame while preserving attributes

Usage

Rsubset(Data, StartT = 0, EndT = 0, Var = NULL, Test = TRUE)

Arguments

Data

The data.frame from which a subset is extracted. Must contain a POSIX-format Time variable.

StartT

HHMMSS-format starting time, or 0 to start at the first row.

EndT

HHMMSS-format ending time, or 0 to end at the last row

Var

A character vector of variables to include, or 'ALL' to include all columns in the data.frame. The default is 'ALL', and Var=NULL produces this result also.

Test

A logical vector used to include rows. The default is TRUE, which will include all rows. This is provided so that tests like (Data$TASX > 130) can restrict what is included in the subset data.frame

Details

The 'subset()' or '[]' methods remove global attributes from the resulting data.frame. This function preserves those attributes or, where necessary (e.g., Dimensions), changes them appropriately.

Value

A subset data.frame that retains the attributes of the original data.frame.

Author(s)

William Cooper

Examples

DS <- Rsubset (RAFdata, 201100,201230)


NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.