[未知用户] DiagrammeR 升级之后不支持了,得降版本
install_version("DiagrammeR", version = "0.8.1", repos = "cran.us.r-project.org")
install_version("DiagrammeR", version = "0.8.1", repos = "cran.us.r-project.org")
test<-function(x){
temp<-ovun.sample(ls14~.,data=data1,method="under",p=1/x)$data
return(head(temp))
Error in (function (formula, data, method, subset, na.action, N, p = 0.5, :
object 'x' not found
Called from: eval(expr, envir, enclos)
x<-5
temp<-ovun.sample(ls14~.,data=data1,method="under",p=1/x)$data
数据集为:
<br />
temp.tpr temp.fpr temp.depth<br />
1 1.0000000 0.0710676626 0.084244721<br />
2 1.0000000 0.0407513181 0.054358419<br />
3 0.9389313 0.0314147627 0.044288035<br />
4 0.9312977 0.0239455185 0.036816459<br />
5 0.9236641 0.0207601054 0.033567948<br />
6 0.9160305 0.0168057996 0.029561451<br />
7 0.8778626 0.0144991213 0.026746075<br />
</p>
代码为
<br />
d <- pretty(range(temp.plot$temp.tpr), 20)<br />
e <- pretty(range(temp.plot$temp.depth), 20)<br />
ggplot(temp.plot,aes(x=temp.depth,y=temp.tpr))+<br />
geom_line(aes(color="blue"))+<br />
geom_line(aes(x=temp.fpr,y=temp.tpr,color="red"))+<br />
scale_x_continuous("prob",breaks=e)+<br />
scale_y_continuous(breaks=d)+<br />
scale_color_hue("chart",labels=c("ROC","lorenz"))<br />
</p>
这样画出来的2个图,ROC的X轴会替代掉lorenz的,怎么才能在同样的X,Y坐标下,画出这2个图来呢?
谢谢各位~[s:15]