diff --git a/R-package/R/getinfo.xgb.DMatrix.R b/R-package/R/getinfo.xgb.DMatrix.R index 5b438049c..3a79fd2fb 100644 --- a/R-package/R/getinfo.xgb.DMatrix.R +++ b/R-package/R/getinfo.xgb.DMatrix.R @@ -4,20 +4,23 @@ setClass('xgb.DMatrix') #' #' Get information of an xgb.DMatrix object #' -#' @param object Object of class "xgb.DMatrix" -#' @param name the name of the field to get -#' #' @examples #' data(iris) #' iris[,5] <- as.numeric(iris[,5]) #' dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5]) #' labels <- getinfo(dtrain, "label") +#' @rdname getinfo #' @export #' getinfo <- function(object, ...){ UseMethod("getinfo") } +#' @param object Object of class "xgb.DMatrix" +#' @param name the name of the field to get +#' @param ... other parameters +#' @rdname getinfo +#' @method getinfo xgb.DMatrix setMethod("getinfo", signature = "xgb.DMatrix", definition = function(object, name) { if (typeof(name) != "character") { diff --git a/R-package/R/slice.xgb.DMatrix.R b/R-package/R/slice.xgb.DMatrix.R index 0c56829fa..8a93efc4d 100644 --- a/R-package/R/slice.xgb.DMatrix.R +++ b/R-package/R/slice.xgb.DMatrix.R @@ -6,22 +6,25 @@ setClass('xgb.DMatrix') #' Get a new DMatrix containing the specified rows of #' orginal xgb.DMatrix object #' -#' @param object Object of class "xgb.DMatrix" -#' @param idxset a integer vector of indices of rows needed -#' #' @examples #' data(iris) #' iris[,5] <- as.numeric(iris[,5]) #' dtrain <- xgb.DMatrix(as.matrix(iris[,1:4]), label=iris[,5]) #' dsub <- slice(dtrain, 1:3) +#' @rdname slice #' @export #' slice <- function(object, ...){ UseMethod("slice") } +#' @param object Object of class "xgb.DMatrix" +#' @param idxset a integer vector of indices of rows needed +#' @param ... other parameters +#' @rdname slice +#' @method slice xgb.DMatrix setMethod("slice", signature = "xgb.DMatrix", - definition = function(object, idxset) { + definition = function(object, idxset, ...) { if (class(object) != "xgb.DMatrix") { stop("slice: first argument dtrain must be xgb.DMatrix") } diff --git a/R-package/R/xgb.DMatrix.save.R b/R-package/R/xgb.DMatrix.save.R index b108c2dad..4fcb71301 100644 --- a/R-package/R/xgb.DMatrix.save.R +++ b/R-package/R/xgb.DMatrix.save.R @@ -2,7 +2,7 @@ #' #' Save xgb.DMatrix object to binary file #' -#' @param model the model object. +#' @param DMatrix the model object. #' @param fname the name of the binary file. #' #' @examples diff --git a/R-package/man/getinfo.Rd b/R-package/man/getinfo.Rd index 4f63b5e92..05a25c152 100644 --- a/R-package/man/getinfo.Rd +++ b/R-package/man/getinfo.Rd @@ -1,14 +1,20 @@ % Generated by roxygen2 (4.0.1): do not edit by hand +\docType{methods} \name{getinfo} \alias{getinfo} +\alias{getinfo,xgb.DMatrix-method} \title{Get information of an xgb.DMatrix object} \usage{ getinfo(object, ...) + +\S4method{getinfo}{xgb.DMatrix}(object, name) } \arguments{ \item{object}{Object of class "xgb.DMatrix"} \item{name}{the name of the field to get} + +\item{...}{other parameters} } \description{ Get information of an xgb.DMatrix object diff --git a/R-package/man/slice.Rd b/R-package/man/slice.Rd index 06d79f6c4..7acb14a32 100644 --- a/R-package/man/slice.Rd +++ b/R-package/man/slice.Rd @@ -1,15 +1,21 @@ % Generated by roxygen2 (4.0.1): do not edit by hand +\docType{methods} \name{slice} \alias{slice} +\alias{slice,xgb.DMatrix-method} \title{Get a new DMatrix containing the specified rows of orginal xgb.DMatrix object} \usage{ slice(object, ...) + +\S4method{slice}{xgb.DMatrix}(object, idxset, ...) } \arguments{ \item{object}{Object of class "xgb.DMatrix"} \item{idxset}{a integer vector of indices of rows needed} + +\item{...}{other parameters} } \description{ Get a new DMatrix containing the specified rows of diff --git a/R-package/man/xgb.DMatrix.save.Rd b/R-package/man/xgb.DMatrix.save.Rd index d4932fa42..e5e70501d 100644 --- a/R-package/man/xgb.DMatrix.save.Rd +++ b/R-package/man/xgb.DMatrix.save.Rd @@ -6,7 +6,7 @@ xgb.DMatrix.save(DMatrix, fname) } \arguments{ -\item{model}{the model object.} +\item{DMatrix}{the model object.} \item{fname}{the name of the binary file.} }