# NOT RUN {
data(baboons)
head(baboons) #see that locations are in geographic coordinates
lon.na <- which(is.na(baboons$location.long) == TRUE) #pull row ids of lon NAs
lat.na <- which(is.na(baboons$location.lat) == TRUE) #pull row ids of lat NAs
baboons.naRM <- droplevels(baboons[-unique(c(lon.na, lat.na)),]) #remove NAs
baboons.naRM_planar <- makePlanar(x = baboons.naRM,
x.lon = baboons.naRM$location.long, x.lat = baboons.naRM$location.lat,
origin.lon = NULL, origin.lat = NULL, datum = "WGS84") #note no specified origin coords
head(baboons.naRM_planar) #see that planar coordinates are reported
# }
Run the code above in your browser using DataLab