《区域水环境污染数据分析实践》Data analysis practice of regional water environment pollution
中国科学院大学资源与环境学院中国科学院生态环境研究中心
2026-05-21
knitr::include_graphics("../../image/tidy-1.png", dpi = 270)
require(patchwork) plot(1:10) 1:10 |> plot() plot(x = 1:10, y = sin(1:10)) 1:10 |> plot(y = sin(1:10))
require(magrittr) 1:10 %>% plot() 1:10 %>% plot(y = sin(1:10)) sin(1:10) %>% plot(1:10, .) sin(1:10) |> plot(x = 1:10, y = _)
# Strive for: short_flights <- flights |> filter(air_time < 60) # Avoid: SHORTFLIGHTS <- flights |> filter(air_time < 60) # Strive for z <- (a + b)^2 / d # Avoid z <- (a + b)^2 / d # Strive for mean(x, na.rm = TRUE) # Avoid mean(x, na.rm = TRUE)
flights |> filter(dest == "IAH") |> group_by(year, month, day) |> summarize(n = n(), delay = mean(arr_delay, na.rm = TRUE)) |> filter(n > 10)