[R-sig-Geo] error "not a numeric vector" when use function "localG"
Marcelino de la Cruz
marcelino.delacruz at upm.es
Thu Mar 12 19:16:42 CET 2009
Dear Cristina,
It sounds like a problem with the decimal
separator in your raw data. If it is a comma,
that can explain your problem. When reading the data in R indicate sep=","
HTH
Marcelino
At 18:29 12/03/2009, Huang Juying wrote:
>Content-Type: text/plain
>Content-Disposition: inline
>Content-length: 828
>
>Dear list members,
>
>I am a new R user and spdep user. I tried to use
>function "localG" to calculate Getis Gi. My
>targeted variable is log(SalePrice) for over
>1000 houses. The listw is the number of neighbors within 3000m.
>
> > SalePrice.Gi <- localG(SalePrice, nb3000m.W, zero.policy=TRUE)
>
>Then I got this error: SalePrice is not a numeric vector
>
>I don't understand why. All SalePrice data is
>numeric, with 6 decimal precision. I tried to
>import SalePrice from .dat or .txt or .csv file,
>but got the same error. I tried to play with the
>header and column/row argument, still no use.
>
>I am really frustrated. I guess there is a
>simple solution, but I just cannot find it!!!
>Please help me! Thank you in advance!
>
>Christina
>USC Geography department
>
>
>
>
>
> [[alternative HTML version deleted]]
>
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at stat.math.ethz.ch
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
________________________________
Marcelino de la Cruz Rot
Departamento de Biología Vegetal
E.U.T.I. Agrícola
Universidad Politécnica de Madrid
28040-Madrid
Tel.: 91 336 54 35
Fax: 91 336 56 56
marcelino.delacruz at upm.es
More information about the R-sig-Geo
mailing list