Skip to content
This repository was archived by the owner on Aug 17, 2024. It is now read-only.
This repository was archived by the owner on Aug 17, 2024. It is now read-only.

Preparing grouped summaries: expectation and replication #427

Description

@larnsce

I am trying to replicate the output of the following R Code chunk in TidyBlocks:

library(palmerpenguins)
library(dplyr)

penguins %>%
  group_by(species) %>%
  summarise(species_count = n()) 
#> `summarise()` ungrouping output (override with `.groups` argument)
#> # A tibble: 3 x 2
#>   species   species_count
#>   <fct>             <int>
#> 1 Adelie              152
#> 2 Chinstrap            68
#> 3 Gentoo              124

Created on 2020-10-30 by the reprex package (v0.3.0)

I have managed to do so with the following Block:

grafik

I expected the following to work:

grafik

Question 1: Why is the output of summarise not collapsed into 2 columns and 3 rows? It seems counterintutive that a new column is added to the original data instead.

Question 2: How do I name the output object? On the right pane und the tab "Results" I see "unnamed 1" and have not managed to figure out how to change this name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions