Skip to content
Prev 3424 / 7420 Next

error in layernames and RasterStack

That's because the function maxlike explicitly calls "layerNames(rasters)" in

     cd.names <- layerNames(rasters)

By typing 

   maxlike()

you can see the code and find the statement mentioned above.  The two fixes are (1) make your own version of maxlike with the "names" fix and/or write the developer of maxlike and let him or her know about this issue.

Jim

-----Original Message-----
From: Alok K. Bohara [mailto:bohara at unm.edu] 
Sent: Friday, December 07, 2012 7:03 AM
To: Baldwin, Jim -FS; r-sig-ecology at r-project.org
Subject: RE: error in layernames and RasterStack

Thanks Jim.  names(r) <--   command  worked...

I still get this error  although I  get the estimates and their standard errors...
Warning message:
In layerNames(rasters) :
  the layerNames function is obsolete. Use "names" instead

Coefficients:
               Est    SE      z  P(>|z|)
(Intercept) -0.817 0.221 -3.687 2.27e-04
x1           1.157 0.129  8.987 2.54e-19
x2           0.152 0.190  0.801 4.23e-01
x3          -0.102 0.109 -0.933 3.51e-01




Alok K. Bohara, Ph.D.
UNM
Message-ID: <DDC5EC9B78340042B0D5A0C3789D456919989473@001FSN2MPN1-062.001f.mgd2.msft.net>
In-Reply-To: <26DA675B6786904E912DCE264169317102E89A09@CH1PRD0711MB406.namprd07.prod.outlook.com>