[R-package] various fixes for R CMD check (#1328)

* [R] fix xgb.create.features

* [R] fixes for R CMD check
This commit is contained in:
Vadim Khotilovich
2016-07-04 12:40:35 -05:00
committed by Tianqi Chen
parent f8d23b97be
commit 11efa038bd
22 changed files with 49 additions and 39 deletions

View File

@@ -186,7 +186,7 @@ getinfo <- function(object, ...) UseMethod("getinfo")
#' @rdname getinfo
#' @export
getinfo.xgb.DMatrix <- function(object, name) {
getinfo.xgb.DMatrix <- function(object, name, ...) {
if (typeof(name) != "character" ||
length(name) != 1 ||
!name %in% c('label', 'weight', 'base_margin', 'nrow')) {
@@ -211,7 +211,7 @@ getinfo.xgb.DMatrix <- function(object, name) {
#' @param name the name of the field to get
#' @param info the specific field of information to set
#' @param ... other parameters
#'
#'
#' @details
#' The \code{name} field can be one of the following:
#'
@@ -237,7 +237,7 @@ setinfo <- function(object, ...) UseMethod("setinfo")
#' @rdname setinfo
#' @export
setinfo.xgb.DMatrix <- function(object, name, info) {
setinfo.xgb.DMatrix <- function(object, name, info, ...) {
if (name == "label") {
if (length(info) != nrow(object))
stop("The length of labels must equal to the number of rows in the input data")
@@ -341,6 +341,8 @@ slice.xgb.DMatrix <- function(object, idxset, ...) {
#'
#' dtrain
#' print(dtrain, verbose=TRUE)
#'
#' @method print xgb.DMatrix
#' @export
print.xgb.DMatrix <- function(x, verbose=FALSE, ...) {
cat('xgb.DMatrix dim:', nrow(x), 'x', ncol(x), ' info: ')