Error in 1:object$nsdf : argument of length 0 when using plot.gam [duplicate]

蹲街弑〆低调 提交于 2019-12-10 14:14:07

问题


I am seeing the error message when trying to plot a gam object in R:

Error in 1:object$nsdf : argument of length 0

I am using the basic command:

plot(myGamObject)

This error is not specific to any data I am using as it also comes up at the end of the routine:

example(gam)

For completeness, here is some sample code:

library(ISLR)
library(gam)
gam7 <- gam(wage~lo(year, span = 2) + s(age, 4) + maritl + education + health_ins + health + jobclass, data = Wage)
plot(gam7)

and here is my system:

   sysname        release        version       nodename 
 "Windows"     ">= 8 x64"   "build 9200" "MEANMACHINE4" 
   machine          login           user effective_user 
  "x86-64"       "Julian"       "Julian"       "Julian" 

回答1:


I have updated to the latest R 3.2.4, and updated all my packages and I've got everything working.



来源:https://stackoverflow.com/questions/35699399/error-in-1objectnsdf-argument-of-length-0-when-using-plot-gam

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!