-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
170 lines (141 loc) · 6.27 KB
/
index.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
---
title: '**Ciência com R**'
subtitle: 'Perguntas e respostas para pesquisadores e analistas de dados'
author: '© 2023-`r format(Sys.Date(), "%Y")` by Arthur de Sá Ferreira <a id="cy-effective-orcid-url" class="underline"s href="https://orcid.org/0000-0001-7014-2002" target="orcid.widget" rel="me noopener noreferrer" style="vertical-align: top"><br><img src="https://orcid.org/sites/default/files/images/orcid_16x16.png" style="width: 1em; margin-inline-start: 0.0em" alt="ORCID iD icon"/> https://orcid.org/0000-0001-7014-2002 </a>'
url: 'https://ferreiraas.github.io/Ciencia-com-R/'
cover-image: "images/Cover_1.png"
description:
'Este livro responde a diversas questões relacionadas a análise estatística de dados, revisitando o principais conceitos e sugerindo métodos computacionais para os mais diversos delineamentos de estudos científicos.'
site: bookdown::bookdown_site
github-repo: 'https://github.com/FerreiraAS/Ciencia-com-R'
geometry: "top=3cm,left=3cm,right=2cm,bottom=2cm"
bibliography: [bib/references.bib]
link-citations: yes
csl: csl/american-medical-association-10th-edition.csl
always_allow_html: true
documentclass: book
papersize: a4
lot: yes
lof: yes
---
```{r, results = "hide", include = FALSE}
options(tinytex.compile.min_times = 3)
options(scipen = 999)
```
```{=latex}
\DisableFootNotes
```
```{r nojekyll, results = "hide", include = FALSE}
if(!file.exists(".nojekyll")) {
file.create('.nojekyll')
}
```
```{r packages, echo = FALSE, results = 'hide', include = FALSE}
library("dplyr")
library("webshot")
```
```{r copy-file, echo = FALSE, results = "hide", include = FALSE}
# PPTX file
file.copy(
from = "Ciencia-com-R.pptx",
to = "Office/Ciencia-com-R.pptx",
overwrite = TRUE,
recursive = FALSE,
copy.mode = TRUE
)
try(unlink("Ciencia-com-R.pptx"), silent = TRUE)
# DOCX file
file.copy(
from = "Ciencia-com-R.docx",
to = "Office/Ciencia-com-R.docx",
overwrite = TRUE,
recursive = FALSE,
copy.mode = TRUE
)
try(unlink("Ciencia-com-R.docx"), silent = TRUE
)
```
```{r cover-generator, echo = FALSE, include = FALSE, eval = knitr::is_html_output()}
source("covers/cover_1.R", local = knitr::knit_global())
source("covers/cover_2.R", local = knitr::knit_global())
source("covers/cover_4.R", local = knitr::knit_global())
```
```{r sobre, echo = FALSE, results = "asis", eval = knitr::is_html_output()}
cat('# Capa {-}')
```
```{r capa, fig.align = 'right', echo = FALSE, results = "asis", include = identical(knitr:::pandoc_to(), 'html'), eval = knitr::is_html_output()}
cat('\n\n')
cat('<center>')
cat('')
cat('\n\n')
cat('</center>')
```
```{=latex}
\clearpage
\markboth{}{}
```
<div class="boxBorder">
Ferreira, Arthur de Sá. **Ciência com R: Perguntas e respostas para pesquisadores e analistas de dados**. Rio de Janeiro: 1a edição, 2023. `r try(paste0(pdftools::pdf_info("docs/Ciencia-com-R.pdf")$pages, "p."), silent = TRUE)` `r if(knitr::is_html_output()){'<a href="https://doi.org/10.5281/zenodo.8320232" style="vertical-align:middle;"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.8320232.svg" alt="DOI" style="vertical-align:top;"></a>'} else {'[doi: 10.5281/zenodo.8320232](https://doi.org/10.5281/zenodo.8320232).'}`
</div>
```{=latex}
\vspace*{\fill}
```
<br>
```{r ficha, echo = FALSE, results = "asis", eval = !knitr::is_html_output()}
cat(paste0('Copyright © 2023-', format(Sys.Date(), "%Y")), 'Arthur de Sá Ferreira')
cat('\n\n')
cat('\n\n')
cat('Todos os direitos reservados. Nenhuma parte deste livro pode ser reproduzida ou usada de qualquer maneira sem a permissão prévia por escrito do proprietário dos direitos autorais, exceto para o uso de breves citações em uma resenha do livro.')
cat('\n\n')
cat('Para solicitar permissões, entre em contato com [email protected]')
cat('\n\n')
cat('Capa dura: ISBN')
cat('\n\n')
cat('Brochura: ISBN')
cat('\n\n')
cat('E-book: ISBN')
```
```{r visit-counter, echo = FALSE, results = "asis"}
if(knitr::is_html_output()){
cat('<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Licença Creative Commons" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png"/></a>')
cat('<br>')
cat('A versão online desta obra está licenciada com uma Licença <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Atribuição-NãoComercial 4.0 Internacional.</a>')
cat('<br>')
cat('<br>')
cat('<b>Ciência com R</b> por <b>Arthur de Sa Ferreira</b> está licenciada sob a <a rel="license" data-spdx="Apache-2.0></a>" href="https://www.apache.org/licenses/LICENSE-2.0">Apache License 2.0</a>.<br>')
cat(paste0(' Atualizado em ', format(Sys.Date(), "%d/%m/%Y")))
cat('<br>')
cat('<br>')
cat('<center>[](https://hits.seeyoufarm.com)</center>')
}
```
```{r post, echo = FALSE, include = FALSE, eval = FALSE}
# delete .PNG files from posts folder
delete_files <- list.dirs("posts", full.names = TRUE)
unlink(delete_files, recursive = TRUE)
# create folder "posts"
dir.create("posts", showWarnings = FALSE)
# source scripts
source(file.path("R", "parseRmd.R"), local = knitr::knit_global())
source(file.path("R", "savePost.R"), local = knitr::knit_global())
# read all file chapters
rmd_files <- list.files("rmd", pattern = "\\.Rmd$", full.names = TRUE)
# remove specific chapters
rmd_files <- rmd_files[!grepl("agradecimentos.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("autor.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("dedicatoria.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("parte-1.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("parte-2.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("parte-3.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("parte-4.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("parte-5.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("testes-estatisticos.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("prefacio.Rmd", rmd_files)]
rmd_files <- rmd_files[!grepl("referencias.Rmd", rmd_files)]
# read bib file
bib <- RefManageR::ReadBib(file.path("bib", "references.bib"))
# loop over all chapters
for (k in seq_along(rmd_files)) {
ParseRmdContent(rmd_files, bib, k)
}
```