Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use R language to visually fill the map

Shulou Source: shulou.com Published: 2022-06-02 06:22:40 10月02日 Update

This article mainly introduces "how to visually fill the map with R language". In the daily operation, I believe that many people have doubts about how to visually fill the map with R language. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubt of "how to visually fill the map with R language"! Next, please follow the editor to study!

Today, I would like to introduce the third function in the REmap function family-REmapC.

The REmapC function allows us to make fill, dot and line graphs on the same map at the same time.

Library (REmap)

Library (baidumap)

? remapC

RemapC (data

Maptype = 'china'

MarkLineData = NULL

MarkPointData = NULL

Color = c ('# 1e90ffy')

Theme = get_theme ("Bright")

Title = ""

Subtitle = ""

MarkLineTheme = markLineControl ()

MarkPointTheme = markPointControl ()

GeoData = NA

Mindata = NA

Maxdata = NA)

Four main parameters are described:

Parameter 1: data is the original data frame format data, a total of 2 columns, the first column is the province or city name, the second column is the corresponding value, the value size will determine the color of the map.

Parameter 2: maptype is set for map type. You can choose world, china or the name of Chinese province.

Parameter 3: color is the gradient color of the thermal map, the default is 2 colors, the first is the termination color, and the second is the initial color. If there is only one color, the system will automatically supplement with white as the initial cesium color.

Parameter 4: mindata and maxdata can set the upper and lower limits of the data corresponding to the color extremes (the default is to use the maximum and minimum values of the data in data as the extremes at both ends).

I. National Thermal Map

First of all, the names of provinces in China are extracted by using the mapnames function:

Province

Tags: Map data function parameter province color population national Guangdong language visualization learning maximum name minimum flow of people numerical value maximum gourd Dandong Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB macOS Docker Shulou Tech Info Huawei