quantregForest x不包含任何数据

时间:2018-11-28 20:59:34

标签: r

运行此代码:

library(datasets)
library(quantregForest)

Xtrain <- iris$Sepal.Length
Ytrain <- iris$Petal.Width

model <- quantregForest(
    x = Xtrain
    , y = Ytrain
)

但收到此错误消息:

Error in quantregForest(x = Xtrain, y = Ytrain) :  x contains no data

任何人都可以看到问题在哪里吗?

PS:

这可以:

library(datasets)
library(quantregForest)
library(dplyr)

Xtrain <- iris %>%
    select(
        Sepal.Length
        , Petal.Length
    )

Ytrain <- iris$Petal.Width

model <- quantregForest(
    x = Xtrain
    , y = Ytrain
)

0 个答案:

没有答案