Skip to content

Flowmap.blue widget for R

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

e-kotov/flowmapblue.R

 
 

Repository files navigation

Flowmap.blue R widget

R-CMD-check

WORK IN PROGRESS

This is a Flowmap.blue widget for R. It produces an interactive flow map representing numbers of movements between locations (origin-destination data).

You might also consider using this pure R flowmapping library: https://github.com/JohMast/flowmapper

As an alternative, you may also consider using R to populate a spreadsheet for publishing on Flowmap.blue as described in this excellent blog post.

Installation

From CRAN (when available):

# install.packages("flowmapblue")

To install from GitHub you will need to install remotes if you don’t have it yet:

if (!require("remotes")) install.packages("remotes")

remotes::install_github("FlowmapBlue/flowmapblue.R",
  force = TRUE, dependencies = TRUE)

Quick example

Setup your Mapbox access token. You can obtain a free token by signing up at Mapbox.

Sys.setenv(MAPBOX_API_TOKEN = "YOUR_MAPBOX_ACCESS_TOKEN")
# load locations and flows for Switzerland
data(ch_locations)
data(ch_flows)

flowmap <- flowmapblue(
 ch_locations,
 ch_flows,
 mapboxAccessToken = Sys.getenv('MAPBOX_API_TOKEN'),
 clustering = TRUE,
 darkMode = TRUE,
 animation = FALSE
)

# view the map
flowmap

Here is a nice intro blog post by Paula Moraga.

For more examples with time and date in flows data, as well as integration with Shiny, see the Quick Start vignette and documentation for the package functions at https://flowmapblue.github.io/flowmapblue.R/.

About

Flowmap.blue widget for R

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 92.6%
  • JavaScript 7.4%