[R] remove unused imports in tests (#8614)

This commit is contained in:
James Lamb
2022-12-24 13:45:47 -06:00
committed by GitHub
parent c430ae52f3
commit f489d824ca
16 changed files with 65 additions and 69 deletions

View File

@@ -1,6 +1,3 @@
require(xgboost)
require(Matrix)
context("testing xgb.DMatrix functionality")
data(agaricus.test, package = 'xgboost')
@@ -123,7 +120,7 @@ test_that("xgb.DMatrix: colnames", {
test_that("xgb.DMatrix: nrow is correct for a very sparse matrix", {
set.seed(123)
nr <- 1000
x <- rsparsematrix(nr, 100, density = 0.0005)
x <- Matrix::rsparsematrix(nr, 100, density = 0.0005)
# we want it very sparse, so that last rows are empty
expect_lt(max(x@i), nr)
dtest <- xgb.DMatrix(x)