R/Vegsoup-Import.R

.make.names <- function (x)  {
	x <- make.names(x, unique = FALSE)
	x <- lapply(strsplit(x, "\\."),
	function(x) if (length(x) > 1)
		substring(x, 1, 4)
	else x)
	x <- unlist(lapply(x,
		function (x) if (length(x) > 1) 
		paste(x[seq(1, length(x))], collapse = " ")
	else x))
	x <- gsub("ssp  ", "", x, fixed = TRUE)
	x <- gsub("var  ", "", x, fixed = TRUE)
	x <- gsub("  ", " ", x, fixed = TRUE)
	x <- abbreviate(x, 8)
   	x <- make.names(x, unique = TRUE)
	x
}

Try the vegsoup package in your browser

Any scripts or data that you put into this service are public.

vegsoup documentation built on Feb. 24, 2021, 3 a.m.