In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to use R language to make thermal data maps, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
What I share with you today is to use R language to make thermal data map.
Perhaps many friends are still very strange to the R language and feel very mysterious.
Indeed, R language data maps require a long code to write. But just like we learn high mathematics and calculus, no matter how complex the formula is, there will be computing software to do it for you, and you just need to know how to adjust the parameters, control the path, and understand the implementation function of each sentence of code. there is no need to remember the detailed connotation and writing of each string of code.
And most of the code to be written next is not written by myself, but cobbled together from the Internet, collated and summarized. Frankly speaking, most of them can not be written by themselves, and the grammar is very difficult to understand, but they barely know what functions they can achieve.
But I can still achieve my own goal, customize the required indicator data, customize the fill color, label and other appearance and format of the output data map.
First of all, this paper introduces the R language system configuration environment of Rubik's cube:
R version 3.2.3
RStudio Version 0.99.484
Because the operation of the original editor of R language is not flexible enough, I will complete the following data map code operation in R Studio, R's third-party compiler.
Before you begin, you must make sure that the following packages are installed in your R language environment:
Ggplot2
Plyr
Maptools
If you haven't already installed, you need to install install.packages ("ggplot2", "plyr", "maptools") first.
Then download the mapping data file of the map: (the way to get this file is more difficult, so I will share it directly in the network disk, click at the end of the text to read the original text. )
After getting the drawing data package, decompress it and put it in the root directory of C disk. (this path is short and easy to reference, and there is no need to modify the code reference path. )
Here are the formal drawing steps:
1. Load the required R package:
Library (ggplot2)
Library (plyr)
Library (maptools)
2. Read in the drawing data:
China_map = readShapePoly ("c:/rstudy/bou2_4p.shp")
You can view the data structure of the data file through the code:
Summary (china_map)
3. Collate and merge the drawing data
X
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.