8000 GitHub - EirikTengesdal/drawmap: Draw Maps in R
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

EirikTengesdal/drawmap

Repository files navigation

drawmap drawmap website

R-CMD-check License: MIT DOI

The goal of drawmap is to draw maps in R easily. The package provides a simple interface to draw maps with a uniform style, and is particularly useful for drawing maps with multiple layers, such as countries, regions, and points of interest. The package provides the following functions:

  • draw(): Draw a map.
  • load_maps_data(): Load map data using maps::map().
  • load_coordinates(): Load points of interest coördinates from a CSV file.
  • browse_wfsdata(): Browse data from a Web Feature Service (WFS) endpoint.
  • load_wfsdata(): Load data from a Web Feature Service (WFS) endpoint.
  • get_map_data(): Retrieve geospatial data via a URL service (used in load_wfsdata()).
  • merge_sf(): Merge sf objects from a specified folder.
  • harmonise_vars(): Harmonise specified variables across sf objects.
  • theme_map(): Specify ggplot2 custom theme for drawmap::draw() (font and size).

The package is built on top of the ggplot2 and sf packages. It accepts different types of spatial data, such as sf objects and data.frame objects with longitude and latitude columns.

Installation

You can install the development version of drawmap from GitHub with pak::pak() or remotes::install_github():

# Using `pak`:
# install.packages("pak")
pak::pak("EirikTengesdal/drawmap")
# Using `remotes`:
# install.packages("remotes")
remotes::install_github("EirikTengesdal/drawmap")

Example

library(drawmap)
norway <- load_maps_data(countries = "Norway")
europe <- load_maps_data()
p <- draw(
  area_data = norway,
  area_col = "#512888",
  area_fill = "#D4C2ED",
  other_areas_data = europe,
  other_areas_col = "#ADB0B8",
  other_areas_fill = "#D9DCE6",
  annotation_scale = FALSE
)

This yields a map like the one used in the drawmap package logo:

Map depicting Norway and the surrounding countries.

License and copyright

© 2024 Eirik Tengesdal

Licensed under the MIT License.

Author

Eirik Tengesdal
Assistant Professor of Norwegian
Department of Early Childhood Education (BLU)
OsloMet – Oslo Metropolitan University
eirik.tengesdal@oslomet.no

Guest Researcher and PhD Student
Department of Linguistics and Scandinavian Studies (ILN)
University of Oslo
eirik.tengesdal@iln.uio.no
ORCID iD: 0000-0003-0599-8925

About

Draw Maps in R

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Languages

0