pdp plotPartial unable to change zlim

102 views Asked by At

I am plotting some partial dependences plots in R, for random forest. I am using pdp package and it is not reacting to any specification for my limits in z variable. code:

pd <- partial(RF, pred.var= c ( "SOC", "Q"))
plotPartial(pd, zlim=c(1000,3000))

i had also tried: zlim(c(1000,3000), and zmax and min and similars

1

There are 1 answers

0
Valentina Rubio On

Thanks for your suggestion, here is my code

library(randomForest) #fitting RF
library(pdp) #partial dependence analysis
set.seed(100)
RF=randomForest(CorrYield~Year+SOC+pH+ Sorghum+Pbray + FertP+ FertN+ PP_veg +PP_PC, data= RF_sin1 , ntree=500, importance=T, proximity=T)
pd_SOC_P <- partial(RF, pred.var= c("SOC", "Pbray"))
plotPartial(pd_SOC_P,xlab="SOC(%)", ylab="PBray(mg kg^-1)")