R/quicklook.R

#	inherited visulalisation method
#if (!isGeneric("gvisMap")) {
setGeneric("quicklook",
	function (x)
		standardGeneric("quicklook")
)
#}

#	gvisMap package
setMethod("quicklook",
	signature(x = "Vegsoup"),
	function (x) {
		# suppressPackageStartupMessages(require(googleVis))
		pt <- SpatialPointsVegsoup(x)
		if (nrow(pt) > 1) {
			df <- data.frame(LatLong = apply(coordinates(pt)[, c(2,1)], 1,
				function (x) paste(x, collapse = ":")),
			Tip = pt$plot)
		} else {
			df <- data.frame(LatLong = paste(coordinates(pt)[, c(2,1)], collapse = ":"),
			Tip = pt$plot)
		}
		m <- gvisMap(df, "LatLong" , "Tip")
		plot(m)
		return(invisible(m))
	}
)

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.