This function launches an interactive application that let the user place areas of a study on a map. the GPS coordinates of the areas are then returned and can be used in functions. This function should be used only once per study. The result should then be saved in an external file and be reused.

mapLayout(
  layout,
  what = c("areas", "districts"),
  map = getSpMaps(),
  map_builder = TRUE
)

Arguments

layout

object returned by function readLayout

what

Either "areas" or "districts". Indicates what type of object to place on the map.

map

An optional SpatialPolygons or SpatialPolygonsDataFrame object. See getSpMaps

map_builder

logical Add inputs for build custom map ? Defaut to TRUE.

Value

An object of class mapLayout.

Details

With map_builder option, you can build a quiet custom map using spMaps package. This package help you to build SpatialPolygonsDataFrame on Europe. Moreover, you can use two options in the module :

  • "Merge countries" : Some countries like UK or Belgium are firstly rendered in multiple and diffrent area. You can so choose to finally use this countries as one single area on the map

  • "Merge states" : If you need states details but not having one area per state, the map will be incomplete for some countries, plotting only states with area. So you can choose to aggregate the states of the countries. This is done using a nearest states algorithm. The result is available only after layout validation.

See also

Examples

if (FALSE) { # Read the coordinates of the areas in the Antares interface, then convert it # in a map layout. layout <- readLayout() ml <- mapLayout(layout) # visualize mapLayout plotMapLayout(ml) # Save the result for future use save(ml, file = "ml.rda") }