[R] could not plot my spatial species points on the raster data

Girija Kalyani smileismystyl at gmail.com
Sat Sep 27 10:36:53 CEST 2014


Dear Group,

I working with species distribution modeling in R.
I have a raster file (stacked with environmental layers around 24 layers),
i have a shape file.
Both the arster and shape file are of same projections.
I confirmed it.
I have a csv file read which has my species data, but the problem here is
my species aren't getting plotted on the raster data. What could be the
proble.


raster <- raster(choose.files())
plot(raster)
#input the species occurence file
hippo <-read.csv(choose.files())
hippo <- read.table(hippo, header=TRUE, sep=",")
hippo <- hippo[,2:3]
points(hippo$lon,hippo$lat,col="blue",pch=19,cex=0.75,
xlab="Longitude",ylab="Latitude")
map<- readOGR(".", layer= 'lahul')
plot(map, col="grey")
hip <- data.frame(hippo$lon,hippo$lat)
points(hip$lon,hip$lat,col="blue",pch=19,xlab="Longitude",ylab="Latitude")

......
 Any help wil be highly appreciated.
Thanx in advance

	[[alternative HTML version deleted]]



More information about the R-help mailing list