A New Output Format

Minha frase importante

Lista:

  1. Elemento 1
  2. Elemento 2
  3. Elemento 3

Negrito itálico html

library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5     ✓ purrr   0.3.4
## ✓ tibble  3.1.6     ✓ dplyr   1.0.7
## ✓ tidyr   1.1.4     ✓ stringr 1.4.0
## ✓ readr   2.1.1     ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
## Leitura dos dados
survey <- read_csv("dados/kaggle_survey_2021_responses.csv", 
                   locale = locale())
## Rows: 25974 Columns: 369
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (369): Time from Start to Finish (seconds), Q1, Q2, Q3, Q4, Q5, Q6, Q7_P...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
## Separação da primeira linha com a descr. da variável
descricao_survey <- survey %>% 
  slice(n = 1)

# Observações da base
survey_limpo <- survey %>% 
  slice(n = 2:n()) # n() total de linhas na base

Descrição da variável Q2: Gênero

Tabela

tabela_genero <- arrange(count(survey_limpo, Q2), -n)
#survey_limpo %>% count(Q2) %>% arrange(-n) %>% kable()

knitr::kable(tabela_genero)
Q2 n
Man 20598
Woman 4890
Prefer not to say 355
Nonbinary 88
Prefer to self-describe 42

Gráfico de Barras

Meu lindo gráfico de barras a seguir

survey_limpo %>% 
  count(Q2) %>% 
  ggplot() +
    geom_bar(aes(x = reorder(Q2, n), 
                 y = n, fill = Q2) , 
             stat = "identity", show.legend = FALSE
             ) +
  coord_flip() + ylab("Total de Ocorrências") + xlab("Gênero") +
  labs(fill = "Gênero")

Stay Tuned

Please visit the development page of the prettydoc package for latest updates and news. Comments, bug reports and pull requests are always welcome.