-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.qmd
195 lines (158 loc) · 7.82 KB
/
README.qmd
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
---
html-table-processing: none
---
# mastersthesis
<!-- quarto render --profile gfm -->
```{r}
#| label: setup
#| include: false
source(here::here("R", "_setup.R"))
```
<!-- badges: start -->
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![OSF DOI](https://img.shields.io/badge/DOI-10.17605/OSF.IO/YGKTS-1284C5.svg)](https://doi.org/10.17605/OSF.IO/YGKTS)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](https://choosealicense.com/licenses/mit/)
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
<!-- badges: end -->
## Overview
☀️🌙⏰🛌💤🌍🗺️🧭📅🧬🧠🕰️📊📓
This repository contains the [Quarto book](https://quarto.org/docs/books/) of my Master's Thesis: *Is Latitude Associated with Chronotype?* The research compendium is accessible via [The Open Science Framework](https://osf.io/) by clicking [here](https://doi.org/10.17605/OSF.IO/YGKTS).
The assemble of this repository was inspired by Ben Marwick, Carl Boettiger & Lincoln Mullen's article [Packaging Data Analytical Work Reproducibly Using R (and Friends)](https://doi.org/10.1080/00031305.2017.1375986).
## How to use
All analyses in this thesis are fully reproducible and were conducted using the [R programming language](https://www.r-project.org/) alongside the [Quarto](https://quarto.org/) publishing system. The [`renv`](https://rstudio.github.io/renv/) package was used to ensure that the R environment used can be restored (see `renv.lock`). All the computational notebooks can be found in the `qmd` directory.
It's important to note that some restrictions apply to the availability of the main research data, which contain personal and sensitive information. As a result, this data cannot be publicly shared. To run the analyses, users must have an internet connection and request a set of access keys from the author (see *Keys* section).
If you don't feel comfortable with R, I strongly recommend checking Hadley Wickham and Garrett Grolemund's free and online book [R for Data Science](https://r4ds.hadley.nz/) and the Coursera course from John Hopkins University [Data Science: Foundations using R](https://www.coursera.org/specializations/data-science-foundations-r).
To reproduce the analyses do the following steps:
(@) Make sure that you have the latest R version and the following R packages installed in your machine:
```{r}
#| eval: false
install.packages(
c("cli", "here" ,"magrittr", "ragg", "renv", "stats", "stringr")
)
```
(@) Clone this repository.
(@) Open the R project (`mastersthesis.Rproj`).
(@) Run [`renv::restore()`](https://rstudio.github.io/renv//reference/restore.html) to install all software dependencies.
(@) Set all the keys provided by the author in the `.Renviron` file and the `_ssh` folder.
(@) Run `targets::tar_make()` to create every point of the data wrangling process (from the raw data to the cleaned and weighted data).
(@) Run any analysis present in the computational notebooks (`qmd` directory).
## Keys
To access the data and run the notebooks, you will need to set the following keys in the [`.Renviron`](https://bookdown.org/csgillespie/efficientR/set-up.html#:~:text=2.4.6%20The%20.Renviron%20file) file:
- `OSF_PAT`: Your [OSF](https://osf.io/) Personal Access Token (PAT). If you don't have one, go to the settings section of your OSF account and create a new token.
- `MASTERSTHESIS_PASSWORD`: The password for the project's RSA private key (32 bytes).
Additionally, you will need the following keys in the project's `_ssh` folder:
- `id_rsa`: The project's private RSA key (RSA 4096 bits (OpenSSL)).
- `id_rsa.pub`: The project's public RSA key.
These project's keys will be provided by the author of the thesis upon reasonable request. As reasonable requests, I consider those made by researchers with a legitimate interest in the thesis topic, whose projects are of high quality, ethically conducted, and who have obtained all necessary approvals for their research proposal.
## License
[![License:
MIT](https://img.shields.io/badge/license-MIT-green)](https://opensource.org/license/mit/)
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC_BY_4.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)
The code accompanying this thesis is distributed under the [MIT License](https://opensource.org/license/mit/). All documents are released under the [Creative Commons Attribution 4.0 International Public License](https://creativecommons.org/licenses/by/4.0/).
The research data is subject to a private license and is not publicly available due to privacy and ethical considerations.
## Citation
To cite this work, please use the following format:
Vartanian, D. (`r env_vars[["year"]]`). *`r env_vars[["title"]] |> stringr::str_to_sentence()`* [`r env_vars[["academic-title"]]`'s `r env_vars[["type-of-work"]]`, `r env_vars[["university"]]`]. [https://doi.org/10.17605/OSF.IO/YGKTS](https://doi.org/10.17605/OSF.IO/YGKTS)
A BibTeX entry for LaTeX users is:
```
@mastersthesis{vartanian`r env_vars[["year"]]`,
title = {`r env_vars[["title"]] |> stringr::str_to_sentence()`},
author = {Daniel Vartanian},
year = {`r env_vars[["year"]]`},
address = {`r env_vars[["location"]]`},
school = {`r env_vars[["university"]]`},
langid = {`r env_vars[["language"]]`},
url = {https://doi.org/10.17605/OSF.IO/YGKTS},
note = {`r env_vars[["version-note"]]`}
}
```
## Acknowledgments
```{r}
#| echo: false
#| output: asis
htmltools::tags$table(
htmltools::tags$tr(
htmltools::tags$td(
htmltools::tags$br(),
htmltools::tags$br(),
htmltools::tags$p(
htmltools::tags$a(
htmltools::tags$img(
src = "images/usp-logo.svg",
width = 150
),
href = paste0(
"https://www.prpg.usp.br/pt-br/faca-pos-na-usp/",
"programas-de-pos-graduacao/621-modelagem-de-sistemas-complexos"
)
),
align = "center"
),
htmltools::tags$br(),
width = "30%"
),
htmltools::tags$td(
htmltools::tags$p(
"This thesis was developed in the Graduate Program in Modeling ",
"Complex Systems (",
htmltools::tags$a(
"PPGSCX",
href = paste0(
"https://www.prpg.usp.br/pt-br/faca-pos-na-usp/",
"programas-de-pos-graduacao/621-modelagem-de-sistemas-complexos"
),
.noWS = "outside"
),
") at the University of São Paulo (",
htmltools::tags$a(
"USP",
href = "https://www5.usp.br/",
.noWS = "outside"
),
") under the supervision of",
htmltools::tags$a(
"Prof. Dr. Camilo Rodrigues Neto",
href = "https://orcid.org/0000-0001-6783-6695",
.noWS = "after"
),
"."
),
width = "70%"
)
)
) |>
knitr::raw_html()
htmltools::tags$table(
htmltools::tags$tr(
htmltools::tags$td(
htmltools::tags$br(),
htmltools::tags$p(
htmltools::tags$a(
htmltools::tags$img(
src = "images/capes-logo-original.svg",
width = 120
),
href = "https://www.gov.br/capes/"
),
align = "center"
),
htmltools::tags$br(),
width = "30%"
),
htmltools::tags$td(
htmltools::tags$p(
"This study was financed by the Coordenação de Aperfeiçoamento de ",
"Pessoal de Nível Superior - Brazil (",
htmltools::tags$a(
"CAPES",
href = "https://orcid.org/0000-0001-6783-6695",
.noWS = "outside"
),
") - Finance Code 001, Grant Number 88887.703720/2022-00."
),
width = "70%"
)
)
) |>
knitr::raw_html()
```