kver.to.shapefile {biology}R Documentation

~~function to do ... ~~

Description

~~ A concise (1-5 lines) description of what the function does. ~~

Usage

kver.to.shapefile(ver, path = paste(getwd(), "/", sep = "", collapse = NULL))

Arguments

ver ~~Describe ver here~~
path ~~Describe path here~~

Details

~~ If necessary, more details than the description above ~~

Value

~Describe the value returned If it is a LIST, use
comp1 Description of 'comp1'
comp2 Description of 'comp2'
...

Note

~~further notes~~

~Make other sections like Warning with Warning .... ~

Author(s)

~~who you are~~

References

~put references to the literature/web site here ~

See Also

~~objects to See Also as help, ~~~

Examples

##---- 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
  }

[Package biology version 1.0 Index]