geospark: Generates Spatial Sparklines as Simple Feature Collection...

Description Usage Arguments Details Value See Also Examples

View source: R/geospark.R

Description

Generates Spatial Sparklines as Simple Feature Collection (sfc)

Usage

1
geospark(coords, my_stats, width, height, direction = "ne", mode = "normal")

Arguments

coords

Points coordinates

my_stats

Values associated to points as a column-wise (long) format. For instance, one column = one date

width

Total width of the line

height

Total height of the line

direction

Direction of lines, upward (north), downward (south), left (west) or right (east). For instance, "ne" will generate upward right lines, "sw" will generated downward left lines.

mode

Normal or Log transformation mode

Details

This function calculates sparklines, based on statistical data, for instance Time-Series You can choose width, height of the line, but also direction of the lines. The Log transformation helps having smoother lines when having an exponential evolution. You can pilot the rendering of individual lines with finer details, with singleGeospark

Value

returns a geometry collection (sfc)

returns a geometry collection (sfc)

See Also

geosparklines::singleGeospark(), browseVignettes("geosparklines")

Examples

1
2
3
4
5
6
library(readr)
library(sf)
f <- read_csv("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv")
geosparks <- geospark(f[, c('Long', 'Lat')], f[, 5:ncol(f)], width=20, height=20, mode = 'log')
plot(geosparks)
st_geometry(f) <- geosparks

datagistips/geosparklines documentation built on April 28, 2020, 3:03 p.m.