gl2shp: Convert genlight objects to ESRI shapefiles or kml files
Description
This function exports cordinates in a genlight object to a point shape file (including also individual meta data if available). Coordinates are provided under gl@other$latlong and assumed to be in WGS84 coordinates if no proj4 string is provided.
Usage
gl2shp(gl, type = "shp",
proj4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs",
outfile = "gl", outpath = tempdir(), v = 1)
Arguments
gl
-- genlight containing lat longs [required]
type
-- type of output "kml" or "shp"
proj4
-- proj4string of data set. If not provided WGS84 is taken as default. (see spatialreference.org for other projections)
outfile
-- name (path) of the output shape file
outpath
-- path of the output file. Default is to tempdir(). If to be saved in the current working directory change to "."
v
-- verbosity: if v=0 no output, v=1 reports name and path of output file. default 1
Examples
Run this code# NOT RUN {
gl2shp(testset.gl)
# }
Run the code above in your browser using DataLab