---
output: github_document
params:
  main_repo: main-dashboards-2
  trilha_clean: visualizacao
  turma: 202211-dashboards-2
  nome_curso: Dashboards II
  num_aula: '0'
  download_material: 'FALSE'
---

<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  echo = FALSE
)

library(magrittr)
```

## Informações importantes

```{r results='asis'}
if(params$download_material == TRUE){
 glue::glue("- [Clique aqui](https://github.com/curso-r/{params$main_repo}/raw/master/material_do_curso.zip) para baixar o material do curso.")
  }
```

- Nosso blog: [https://curso-r.com/blog/](https://curso-r.com/blog/)

- [Programando em Shiny](https://programando-em-shiny.curso-r.com/)

- [Ciência de Dados em R](https://livro.curso-r.com/) 

- [Zen do R](https://curso-r.github.io/zen-do-r/)

## Dúvidas

Fora do horário de aula ou monitoria:

- perguntas gerais sobre o curso deverão ser feitas no Classroom.

- perguntas sobre R, principalmente as que envolverem código, deverão ser enviadas no [nosso fórum](https://discourse.curso-r.com/).


## Slides

```{r}
paths <- CursoRopen:::list_github_files(params$main_repo, "slides/", "[0-9]-.*html$") |> 
  tibble::enframe(value = "paths") |> 
  dplyr::filter(!stringr::str_detect(paths, "figure-html")) |> 
  dplyr::mutate(file_path_sem_extencao = tools::file_path_sans_ext(paths)) |> 
  dplyr::select(-name)


paths_pdf <- CursoRopen:::list_github_files(params$main_repo, "slides/", "[0-9]-.*pdf$") |> 
  tibble::enframe(value = "paths_pdf") |> 
  dplyr::mutate(file_path_sem_extencao = tools::file_path_sans_ext(paths_pdf)) |>
  dplyr::select(-name)

dplyr::left_join(paths, paths_pdf, by = "file_path_sem_extencao") |> 
dplyr::mutate(
  slide = paths,
  link = paste0("https://curso-r.github.io/", params$main_repo, "/", slide),
  slides = glue::glue("[{basename(slide)}]({link})"),
  slide_pdf = paths_pdf,
  link_pdf = paste0("https://curso-r.github.io/", params$main_repo, "/", slide_pdf),
  pdf = glue::glue("[{basename(slide_pdf)}]({link_pdf})")
) |> 
  dplyr::filter(!stringr::str_detect(slide, "_files/")) |>
  dplyr::select(slides, pdf) |> 
  dplyr::slice(1:4) |> 
  knitr::kable()
```


## Scripts utilizados em aula

```{r}
pasta <- "pratica/"

knitr::kable(
  tibble::tibble(
    script = list.files(pasta, pattern = "\\.zip$"),
    link = paste0(
      "https://raw.githubusercontent.com/curso-r/",
      params$turma,
      "/main/",
      pasta,
      "/",
      script
    )
  ) %>%
    dplyr::mutate(script = glue::glue("[{script}]({link})")) %>%
    dplyr::select(script)
)
```


## Redes sociais da Curso-R


Youtube: https://www.youtube.com/c/CursoR6/featured

Instagram: https://www.instagram.com/cursoo_r/

Twitter: https://twitter.com/curso_r

Linkedin: https://www.linkedin.com/company/curso-r/

Facebook: https://www.facebook.com/cursodeR



```{r include=FALSE}
# Criar arquivo _config.yml
if(params$download_material == TRUE){
 glue::glue('theme: jekyll-theme-minimal', '\n',
    "logo: assets/logo.png", '\n',
    "title: {params$nome_curso}", '\n',
    "show_downloads: true", '\n',
    "link_material: 'https://github.com/curso-r/{params$main_repo}/raw/master/material_do_curso.zip'", '\n'
    
    ) |>
    readr::write_lines( "_config.yml")
}

if(params$download_material == FALSE){
  glue::glue('theme: jekyll-theme-minimal', '\n',
    "logo: assets/logo.png", '\n',
    "title: {params$nome_curso}", '\n',
    "show_downloads: false", '\n') |>
    readr::write_lines( "_config.yml")
}
```
