Skip to content
Prev 275748 / 398506 Next

vis.gam zlab problem

On Oct 27, 2011, at 6:13 PM, wildlifeduke wrote:

            
`vis.gam` creates that name and it gets pasted into a string that  
result in a collision with your supplied argument at the point where  
they a both passed to `persp`. You will need to hack that code to  
circumvent, or extract the relevant vectors from the gam fit an dbuild  
a plot on your own.

The code to replace would be

  if (type == "link")
         zlab <- paste("linear predictor")

Or perhaps intercept the handling of "stub"'s construction at the end:

             stub <- paste(ifelse("xlab" %in% dnm, "", ",xlab=view[1]"),
                 ifelse("ylab" %in% dnm, "", ",ylab=view[2]"),
                 ifelse("main" %in% dnm, "", ",zlab=zlab"), ",...)",
                 sep = "")
             if (color == "bw") {
                 op <- par(bg = "white")
                 txt <- paste("persp(m1,m2,z,col=\"white 
\",zlim=c(min.z,max.z) ",
                   stub, sep = "")
                 eval(parse(text = txt))
                 par(op)
             }
             else {
                 txt <-  
paste("persp(m1,m2,z,col=col,zlim=c(min.z,max.z)",
                   stub, sep = "")
                 eval(parse(text = txt))