dim.Rd 891 Bytes
Newer Older
Guolin Ke's avatar
Guolin Ke committed
1
2
3
4
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lgb.Dataset.R
\name{dim.lgb.Dataset}
\alias{dim.lgb.Dataset}
5
\title{Dimensions of an lgb.Dataset}
Guolin Ke's avatar
Guolin Ke committed
6
7
8
9
10
11
12
13
14
15
16
17
\usage{
\method{dim}{lgb.Dataset}(x, ...)
}
\arguments{
\item{x}{Object of class \code{lgb.Dataset}}

\item{...}{other parameters}
}
\value{
a vector of numbers of rows and of columns
}
\description{
18
Returns a vector of numbers of rows and of columns in an \code{lgb.Dataset}.
Guolin Ke's avatar
Guolin Ke committed
19
20
21
22
23
24
}
\details{
Note: since \code{nrow} and \code{ncol} internally use \code{dim}, they can also
be directly used with an \code{lgb.Dataset} object.
}
\examples{
25
26
27
28
dontrun{
  data(agaricus.train, package='lightgbm')
  train <- agaricus.train
  dtrain <- lgb.Dataset(train$data, label=train$label)
Guolin Ke's avatar
Guolin Ke committed
29

30
31
32
33
  stopifnot(nrow(dtrain) == nrow(train$data))
  stopifnot(ncol(dtrain) == ncol(train$data))
  stopifnot(all(dim(dtrain) == dim(train$data)))
}
Guolin Ke's avatar
Guolin Ke committed
34
35
}