R/lats2Shape.R

Defines functions `lats2Shape`

`lats2Shape` <-
function(lats) {
  #tests if lats are a matrix or spatial points
  if (inherits(lats, 'SpatialPoints')) lats<-coordinates(lats)
  n<-dim(lats)[1]
  a<-data.frame(Id=1:n,X=lats[,1],Y=lats[,2])    
  aa<-data.frame(Id=1:n,locality=row.names(as.data.frame(lats)),lats)
  ashp<-convert.to.shapefile(a,aa,"Id",1)
  return(ashp)
}

Try the fossil package in your browser

Any scripts or data that you put into this service are public.

fossil documentation built on March 23, 2020, 5:06 p.m.