惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - Luis Yang

博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 博文阅读密码验证 - 博客园 qmake生成VS的vcproj/sln工程文件 R语言爬取动态网页之环境准备 install_github无法安装 Rwebdriver包的解决方法 关于R语言中set.seed() R语言开发环境搭建 博文阅读密码验证 - 博客园 psql连接 PostgreSQL 不输入密码的方法 shell中的cat和文件分界符(<<EOF) sqlplus -S选项说明 oracle中常见set指令 nohup详解 centos64位编译32位程序
R实现pm2.5地图数据展示
Luis Yang · 2018-12-21 · via 博客园 - Luis Yang

使用rvest包抓取pm2.5静态页面数据,使用leafletCN包实现pm2.5数据的地图展示,代码如下所示:

library(rvest)
library(leafletCN)
Sys.setlocale("LC_CTYPE","eng")
doc = read_html("http://www.pm25s.com/cn/rank/")
cities = doc %>% html_nodes(".cityrank a") %>%
  html_text()
AQI = doc %>% html_nodes("span[class^='lv']") %>%
  html_text() %>% .[c(F,F,T)] %>% as.numeric
dat = data.frame(city=cities,AQI=AQI)
dat
geojsonMap(dat,"city",
           popup = paste0(dat$city,":",dat$AQI),
           palette = "Reds",legendTitle = "AQI")

执行结果如下