R/create.lats.R

Defines functions `create.lats`

`create.lats` <- 
function(x, loc="locality", long="longitude", lat="latitude") {
	b<-c(long,lat)
	d<-which(duplicated(x[,loc])==FALSE)
	lm<-x[d,b]
	if (is.null(dim(lm))==TRUE) lm<-matrix(lm,1,2)
	rownames(lm)<-x[d,loc]
	colnames(lm)<-c("longitude","latitude")
	return(lm)
}

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.