Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cols.DTSg

Get Names of Value Columns


Description

Queries all column names of a DTSg object, those of certain classes and/or those matching a certain pattern only.

Usage

## S3 method for class 'DTSg'
cols(x, class = NULL, pattern = NULL, ...)

Arguments

x

A DTSg object (S3 method only).

class

An optional character vector matched to the most specific class (first element) of each column's class vector.

pattern

An optional character string passed on to the pattern argument of grep.

...

Further arguments passed on to grep. The value argument is rejected.

Value

Returns a character vector.

See Also

Examples

# new DTSg object
x <- DTSg$new(values = flow)

# get names of numeric columns
## R6 method
x$cols(class = "numeric")

## S3 method
cols(x = x, class = "numeric")

DTSg

A Class for Working with Time Series Based on 'data.table' and 'R6' with Largely Optional Reference Semantics

v0.7.0
MIT + file LICENSE
Authors
Gerold Hepp [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.