[STATSGRASS] sites.put2 ERROR!!!
Roger Bivand
Roger.Bivand at nhh.no
Wed Oct 29 16:59:46 EST 2003
On Wed, 22 Oct 2003, Massimiliano Cannata wrote:
> Hi users,
> I'm new of this list and I will appreciate any
> help.
Sorry not to have replied earlier, but I couldn't see what was going on.
> Here it is what I've done:
>
> >library(GRASS); G<-gmeta(); mod<-lm(.....................)
> >dataSite<-data.frame(x=matrix(1:11),y=matrix(1:11),
> > z=as.vector(mod$coefficient));
>
Your data frame has three columns, named x, y and z.
> >sites.put2(G,data=dataSite,id=NULL,dims=c("x","y","z"),lname="parametri",all.sites=TRUE,check=FALSE)
>
> Error in
> which(unlist(lapply(data.attr,is.numeric))):
> argument to "which" is not logical
> >
The sites.put2() function drops the id if given, and the dimensions, from
the data attributes. Here x, y, and z are specified as dimensions, so
there are no data attributes left. Consequently, is.numeric is looking at
a NULL data frame with no columns. This is a bug, because either an error
or a warning should be given, a warning if we permit sites without
attributes (and the test put in an if() loop), an error otherwise. So for
the time being use sites.put() with east=x, north=y, and var=z - but this
will make z an attribute and you want it to be a dimension - is this
correct? I'll make the modification to the code for the next release.
Thanks for reporting this.
Roger Bivand
>
> But if I type:
>
> >lapply(unlist(dataS,is.numeric))
> x y z
> TRUE TRUE TRUE
>
> So, what I'm doing wrong?
> Of course I can use sites.put() but just for
> knowledge.......
>
> Thanks you all.
>
>
> --
> -------------
> note: change my e-mail reference to
> massimiliano.cannata at supsi.ch
> because the old one will be deleted soon.
I think you can edit your subscription details on the mailing list website
using the password sent each month.
> -------------
> Ing. Massimiliano Cannata
> Istituto di Scienze della Terra - SUPSI
> C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
> Tel +41 91 /935 12 25 - Fax +41 91 /935 12 09
> eMail: massimiliano.cannata at supsi.ch
> Internet: http://www.ist.supsi.ch
>
>
> _______________________________________________
> statsgrass mailing list
> statsgrass at grass.itc.it
> http://grass.itc.it/mailman/listinfo/statsgrass
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no
More information about the grass-stats
mailing list