Skip to content

Commit

Permalink
Use magrittr pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Sep 30, 2024
1 parent f93774c commit 1a4cb17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ server <- function(input, output, session) {
cars <- tbl(pool, "mtcars")

output$tbl <- renderTable({
cars |> filter(cyl == !!input$cyl) |> collect()
cars %>% filter(cyl == !!input$cyl) %>% collect()
})
output$popPlot <- renderPlot({
df <- cars |> head(input$nrows) |> collect()
pop <- df |> pull("mpg", name = "model")
df <- cars %>% head(input$nrows) %>% collect()
pop <- df %>% pull("mpg", name = "model")
barplot(pop)
})
}
Expand Down
6 changes: 3 additions & 3 deletions vignettes/why-pool.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ server <- function(input, output, session) {
cars <- tbl(pool, "mtcars")
output$tbl <- renderTable({
cars |> filter(cyl == !!input$cyl) |> collect()
cars %>% filter(cyl == !!input$cyl) %>% collect()
})
output$popPlot <- renderPlot({
df <- cars |> head(input$nrows) |> collect()
pop <- df |> pull("mpg", name = "model")
df <- cars %>% head(input$nrows) %>% collect()
pop <- df %>% pull("mpg", name = "model")
barplot(pop)
})
}
Expand Down

0 comments on commit 1a4cb17

Please sign in to comment.