Agus,

If you find NAs in raster data for certain point locations, you probably
should plot these points on that raster.
And then perhaps compare the raster to wrld_simpl. Although it is a bit
simpl, as the name suggests and your plot confirms, most of these red
points are clearly on land.
For a higher resolution coastline you can use, for example,

library(raster)
wrld_cmplx <- getData('countries')

Robert


On Tue, May 8, 2012 at 8:13 AM, Agus Camacho <agus.camacho@gmail.com> wrote:

> Dear all,
>
> When dealing with some occurrences, I found some unexplicable Nas.
> The map attached comes from nothern south america. Red dots are the
> problematic occurences (=without climatic layer data) and the fine ones are
> green.
> It looks to me like there is some mismatching between the occurrences, the
> map and the layers. However, I dont know how to solve it and I am afraid of
> future problems like this for other occurences next to the coast.
> Maybe should I use another coastline database and use the value of the
> nearest raster cell containing data?
>
> Any hint about this problem would be appreciated.
>
> The code used to generate the map and dot was:
> plot(wrld_simpl, xlim=c(min(x$Longitude), max(x$Longitude)),
> ylim=c(min(x$Latitude), max(x$Latitude)),
> axes=TRUE,col='light yellow')
> box()
> points(fine, col='green', pch=20, cex=0.75)
> points(problems, col='red', pch=20, cex=0.75)
>
> Thanks in advance.
> Agus
> --
> Agustín Camacho Guerrero.
> Doutorando em Zoologia.
> Laboratório de Herpetologia, Departamento de Zoologia, Instituto de
> Biociências, USP.
> Rua do Matão, trav. 14, nº 321, Cidade Universitária,
> São Paulo - SP, CEP: 05508-090, Brasil.
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>

	[[alternative HTML version deleted]]

