Learn R Programming

gpboost (version 0.7.9)

dim.gpb.Dataset: Dimensions of an gpb.Dataset

Description

Returns a vector of numbers of rows and of columns in an gpb.Dataset.

Usage

# S3 method for gpb.Dataset
dim(x, ...)

Value

a vector of numbers of rows and of columns

Arguments

x

Object of class gpb.Dataset

...

other parameters

Details

Note: since nrow and ncol internally use dim, they can also be directly used with an gpb.Dataset object.

Examples

Run this code
# \donttest{
data(agaricus.train, package = "gpboost")
train <- agaricus.train
dtrain <- gpb.Dataset(train$data, label = train$label)

stopifnot(nrow(dtrain) == nrow(train$data))
stopifnot(ncol(dtrain) == ncol(train$data))
stopifnot(all(dim(dtrain) == dim(train$data)))
# }

Run the code above in your browser using DataLab