kver.to.shapefile {biology} | R Documentation |
~~ A concise (1-5 lines) description of what the function does. ~~
kver.to.shapefile(ver, path = paste(getwd(), "/", sep = "", collapse = NULL))
ver |
~~Describe ver here~~ |
path |
~~Describe path here~~ |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
##---- Should be DIRECTLY executable !! ---- ##-- ==> Define data, use random, ##-- or do help(data=index) for the standard data sets. ## The function is currently defined as function (ver, path = paste(getwd(), "/", sep = "", collapse = NULL)) { if (class(ver) != "kver") stop("The first parameter must be a kver class object (output of getverticeshr)") a <- lapply(ver, data.frame) b <- lapply(1:length(ver), function(i) data.frame(Id = c(1:nlevels(ver[[i]][[1]])), name = c(1:nlevels(ver[[i]][[1]])))) shape <- lapply(1:length(ver), function(i) convert.to.shapefile(a[[i]], b[[i]], "Id", 5)) out.files <- lapply(1:length(ver), function(i) write.shapefile(shape[[i]], paste(path, names(ver[i]), sep = "", collapse = NULL), arcgis = T)) ifelse(length(ver) == 1, message <- (paste(length(ver), " shapefile has been saved in ", path, sep = "", collapse = NULL)), message <- (paste(length(ver), " shapefiles have been saved in ", path, sep = "", collapse = NULL))) message }