Description Usage Arguments Value Examples
View source: R/xy.project.na.R
Function to change projection of a data.frame
1 | function(dataframe,CRSold,CRSnew,xold,yold,xnew,ynew)
|
dataframe |
A data.frame containing coordinates with column names specified in xold and yold |
CRSold |
The current CRS projection, see example |
CRSnew |
The new CRS projection, see example |
xold |
name of column containing x-coordinate |
yold |
name of column containing y-coordinate |
xnew |
name of column of projected x-coordinate |
ynew |
name of column of projected y-coordinate |
The class of x
is printed as a side-effect.
1 2 3 4 5 6 | d<-data.frame(lon=c(3,4,NA,5),lat=c(51,NA,52,53))
xy.project.na(dataframe=d,
CRSold="+proj=longlat +datum=WGS84",
CRSnew="+proj=utm +zone=31 +ellps=WGS84 +datum=WGS84 +units=m +no_defs +towgs84=0,0,0",
xold="lon",yold="lat",xnew="xutm",ynew="yutm")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.