运行此代码:
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
)