我有一个来自
cva.glmnet()
对象的绘图。
情节的图例碍事,我不知道如何将其移到右侧并为其指定图例标题。
这是一些给出类似问题的示例代码。
set.seed(100)
a <- runif(1000) %>% round()
b <- runif(1000) %>% round()
c <- runif(1000) %>% round()
d <- runif(1000) %>% round()
datatest <- as.data.frame(cbind(a,b,c,d))
cvtest <- cva.glmnet(d ~ a+b+c, data= datatest, family = "binomial")
plot(cvtest)
这是输出的图片:
我尝试添加图例并使用
ggplot()
。