Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solução alternativa [e mais bonitinha] pra questão 5.5 #50

Open
diogoprov opened this issue Jul 13, 2022 · 0 comments
Open

Solução alternativa [e mais bonitinha] pra questão 5.5 #50

diogoprov opened this issue Jul 13, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request v2

Comments

@diogoprov
Copy link
Collaborator

penguins %>%
       nest_by(species) %>%
       mutate(corr_especies = cor(data$bill_length_mm, data$bill_depth_mm, use = "na.or.complete"))%>%
       summarise(corr_especies, .groups = "keep")

vai me retornar uma tabela com os nomes das espécies e as respectivas correlações:

# A tibble: 3 × 2
# Groups:   species [3]
  species   corr_especies
  <fct>             <dbl>
1 Adelie            0.391
2 Chinstrap         0.654
3 Gentoo            0.643
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2
Projects
None yet
Development

No branches or pull requests

2 participants