geojson_boxplotR Documentation

Create boxplot or various boxplots of path lengths between different heritage places

Usage

geojson_boxplot(
  stat.name = "caravanserais_areas",
  concept.name = "hp.id",
  geojson.path = paste0(system.file(package = "eamenaR"),
    "/extdata/caravanserail.geojson"),
  csv.path = paste0(system.file(package = "eamenaR"),
    "/extdata/caravanserail_paths.csv"),
  stat = c("area"),
  chart.type = c("boxplot"),
  by = NA,
  interactive = F,
  export.plot = F,
  dirOut = paste0(system.file(package = "eamenaR"), "/results/"),
  fig.width = 9,
  fig.height = 5,
  color.set = "Set1",
  verbose = TRUE
)

Arguments

stat.name

name of output file and plot. Default "caravanserais_areas".

concept.name

key used to identify heritage places. Default "hp.id".

geojson.path

path of GeoJSON file. Default 'caravanserail.geojson'.

csv.path

path to CSV where edges between two heritage places are recorded.

stat

statistic that will be computed. Different values can be "area" for areas, or "dist" for distances between heritage places. Default 'area'.

chart.type

type of chart that will be plot. Default, "boxplot".

interactive

if TRUE, create a Plotly chart. Default, FALSE.

export.plot

if TRUE, will save the plot. Default, FALSE.

dirOut

folder where outputs will be saved. Default: '/results'. If it doesn't exist, will be created. Only useful is export plot is TRUE.

fig.width, fig.height

size of output chart.

color.set

the RBrewer color set. Default "Set1".

verbose

if TRUE (Default), print messages.

name

of field on which paths will be grouped. Example "route". Will create as many plots as there are different categories. By default NA.

Examples


# boxplot on areas (by default)
geojson_boxplot(stat = "area")

# boxplot on distances
geojson_boxplot(stat = "dist")

# Same as before, but stratified by routes, and saved
geojson_boxplot(stat.name = "caravanserais_areas", stat = "area", by = "route",
                export.plot = T)
geojson_boxplot(stat.name = "caravanserais_dist", stat = "dist", by = "route",
                export.plot = T)

# Same as before, but stratified by routes, interactive, and saved
geojson_boxplot(stat.name = "caravanserais_areas", stat = "area", by = "route",
                interactive = T,
                export.plot = T)
geojson_boxplot(stat.name = "caravanserais_dist", stat = "dist", by = "route",
                interactive = T,
                export.plot = T)