[R] Error: bad index in plotmo functions for MARS model (package earth)

Cleber N.Borges klebyn at yahoo.com.br
Thu Jul 21 17:14:32 CEST 2011


Hello all useRs,

I am tring make a simple surface plot ( 2 by 2 terms of a MARS model 
(with earth package)
but I get the follow error message:

 > plotmo( mars )
Error: bad index (missing column in x?)

I don't no how to workround this... :-(
I thanks in advanced by some help!

Thanks.
Cleber
###############
 >
 > ### example code:
 >  library( earth )
 > data( gasoline, package='pls' )
 >
 > nir <- gasoline$NIR
 > dim( nir )
[1]  60 401
 > class( nir )
[1] "AsIs"
 >
 > oct <- gasoline$octane
 >
 > mars <- earth(  oct ~ nir, nk=300, nfold=10, degree=3, trace=0 )
 >
 > plotmo(  mars )
Error: bad index (missing column in x?)
 > plotmo( mars, all1=T )
Error: bad index (missing column in x?)
 > plotmo( mars, all1=T, all2=T )
Error: bad index (missing column in x?)
 >
 > sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Portuguese_Brazil.1252  
LC_CTYPE=Portuguese_Brazil.1252    LC_MONETARY=Portuguese_Brazil.1252
[4] LC_NUMERIC=C                       LC_TIME=Portuguese_Brazil.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] pls_2.1-0     earth_3.2-0   plotrix_3.2-2 plotmo_1.2-6  leaps_2.9

loaded via a namespace (and not attached):
[1] tools_2.13.1
 >



More information about the R-help mailing list