zlacker

[return to "Google's new pipe syntax in SQL"]
1. minkle+nGa[view] [source] 2024-08-29 07:30:39
>>heyden+(OP)
That is basically R with tidyverse.

  flights |>
    filter(
      carrier == "UA",
      dest %in% c("IAH", "HOU"),
      sched_dep_time > 0900,
      sched_arr_time < 2000
      ) |>
    group_by(flight) |>
    summarize(
      delay = mean(arr_delay, na.rm = TRUE),
      cancelled = sum(is.na(arr_delay)),
      n = n()
      ) |>
    filter(n > 10)
If you haven't used R, it has some serious data manipulation legs built into it.
◧◩
2. countr+1Ta[view] [source] 2024-08-29 09:50:35
>>minkle+nGa
My thoughts exactly, it even uses the same pipe syntax, though I do prefer `%>%`. I've been avoiding SQL for a while now as it feels so clunky next to the tidyverse
[go to top]