Learn R Programming

gpboost (version 1.5.6)

dimnames.gpb.Dataset: Handling of column names of gpb.Dataset

Description

Only column names are supported for gpb.Dataset, thus setting of row names would have no effect and returned row names would be NULL.

Usage

# S3 method for gpb.Dataset
dimnames(x)

# S3 method for gpb.Dataset dimnames(x) <- value

Value

A list with the dimension names of the dataset

A list with the dimension names of the dataset

Arguments

x

object of class gpb.Dataset

value

a list of two elements: the first one is ignored and the second one is column names

Details

Generic dimnames methods are used by colnames. Since row names are irrelevant, it is recommended to use colnames directly.

Examples

Run this code
# \donttest{
data(agaricus.train, package = "gpboost")
train <- agaricus.train
dtrain <- gpb.Dataset(train$data, label = train$label)
gpb.Dataset.construct(dtrain)
dimnames(dtrain)
colnames(dtrain)
colnames(dtrain) <- make.names(seq_len(ncol(train$data)))
print(dtrain, verbose = TRUE)
# }

Run the code above in your browser using DataLab