[R] rename slice to avoid dplyr conflict (#10017)

This commit is contained in:
david-cortes
2024-01-30 22:33:37 +01:00
committed by GitHub
parent df7cf744b4
commit 5e00a71671
5 changed files with 16 additions and 24 deletions

View File

@@ -1,15 +1,12 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/xgb.DMatrix.R
\name{slice}
\alias{slice}
\alias{slice.xgb.DMatrix}
\name{xgb.slice.DMatrix}
\alias{xgb.slice.DMatrix}
\alias{[.xgb.DMatrix}
\title{Get a new DMatrix containing the specified rows of
original xgb.DMatrix object}
\usage{
slice(object, idxset)
\method{slice}{xgb.DMatrix}(object, idxset)
xgb.slice.DMatrix(object, idxset)
\method{[}{xgb.DMatrix}(object, idxset, colset = NULL)
}
@@ -28,7 +25,7 @@ original xgb.DMatrix object
data(agaricus.train, package='xgboost')
dtrain <- with(agaricus.train, xgb.DMatrix(data, label = label, nthread = 2))
dsub <- slice(dtrain, 1:42)
dsub <- xgb.slice.DMatrix(dtrain, 1:42)
labels1 <- getinfo(dsub, 'label')
dsub <- dtrain[1:42, ]
labels2 <- getinfo(dsub, 'label')