Hi friends,
I m new to R studio and I m facing the problem related to expand.grid. I m trying to create the grid for latitude and longitude. Please see the following codes.
tt<-read.csv(file.choose(),header = TRUE)
#print(tt)
head(tt)
library(marmap)
tt0<-getNOAA.bathy(lon1=63,lon2=78,lat1=7,lat2=25,resolution=4)
tt1<-expand.grid(lon,lat)
Error in expand.grid(lon, lat) : object 'lon' not found
the above line is error showed...
Rest of the codes are below
tt2<-get.depth(tt0,as.matrix(tt1[,1:2]),locator = FALSE)
head(tt0)
head(tt1)
head(tt2)
head(tt3)
tt3<-merge(tt2,tt,by=c("lon","lat"))
tt3$include<-0
tt3[tt3$depth>-200 & tt3$depth<0,]$include<-1
I m trying to extract data for 200m depth from whole file...
Please help me.
Thank you