-
-
Save gtgrthrst/121e103e3d43718e74817fe8c1ea6bef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(jsonlite) | |
library(dplyr) | |
aqi<-fromJSON("https://data.epa.gov.tw/api/v1/aqx_p_138?offset=1&limit=100000&api_key=71c8c657-ddd3-44b6-a6c1-8e5a712a42df") | |
str(aqi) | |
temp2.5<-filter(aqi[[6]],ItemEngName=="PM2.5") | |
str(temp2.5) | |
ggplot(temp2.5, mapping = aes(x = as.POSIXct(MonitorDate,format="%Y-%m-%d %H:%M:%S"), | |
y = as.numeric(Concentration),colour = SiteName))+ | |
geom_line() + | |
theme(axis.title=element_blank(), | |
axis.text=element_blank(), | |
axis.ticks=element_blank() | |
) + #刪除XY軸 | |
guides(fill = FALSE, color = FALSE, linetype = FALSE, shape = FALSE) #刪除圖例 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment