Skip to content

Commit 719428c

Browse files
committed
simplication in R template
1 parent 7e81984 commit 719428c

3 files changed

Lines changed: 11 additions & 77 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ extension](https://github.com/computorg/computo-quarto-extension), the
99
knitr kernel (R user) and
1010
[renv](https://rstudio.github.io/renv/articles/renv.html) to set-up the
1111
dependencies.
12-
**All important information about writing and preparing an article to be
13-
submitted to Computo, and related technicalities** are detailed [in the
14-
guidelines for
12+
For a detailed, step-by-step guide on preparing your article and
13+
submitting it to Computo, please consult the [guidelines for
1514
authors](https://computo-journal.org/site/guidelines-authors.html).*
1615

1716
[![build and
@@ -23,8 +22,8 @@ License](https://i.creativecommons.org/l/by/4.0/80x15.png)](http://creativecommo
2322

2423
- [Jane Doe](https://janedoe.someplace.themoon.org) (Name of Affiliation
2524
one)
26-
- [John Doe](https://johndoe.someplace.themoon.org) (Name of
27-
Afficiliation two)
25+
- [John Doe](https://johndoe.someplace.themoon.org) (Name of Affiliation
26+
two)
2827

2928
### Abstract
3029

_quarto.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ date-modified: last-modified
2929
description: |
3030
This document provides a template based on the [quarto](https://quarto.org/) system for contributions to Computo, using the [quarto journal extension](https://github.com/computorg/computo-quarto-extension), the knitr kernel (R user) and [renv](https://rstudio.github.io/renv/articles/renv.html) to set-up the dependencies.
3131
32-
**All important information about writing and preparing an article to be submitted to Computo, and related technicalities** are detailed [in the guidelines for authors](https://computo-journal.org/site/guidelines-authors.html).
32+
For a detailed, step-by-step guide on preparing your article and submitting it to Computo, please consult the [guidelines for authors](https://computo-journal.org/site/guidelines-authors.html).
3333
abstract: >+
3434
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur posuere vestibulum facilisis. Aenean pretium orci augue, quis lobortis libero accumsan eu. Nam mollis lorem sit amet pellentesque ullamcorper. Curabitur lobortis libero eget malesuada vestibulum. Nam nec nibh massa. Pellentesque porttitor cursus tellus. Mauris urna erat, rhoncus sed faucibus sit amet, venenatis eu ipsum.
3535
keywords: [key1, key2, key3]
@@ -38,6 +38,7 @@ github-user: computorg
3838
repo: "template-computo-r"
3939
draft: true # set to false once the build is running
4040
published: false # will be set to true once accepted
41+
license: CC-BY-4.0
4142
format:
4243
computo-html: default
4344
computo-pdf: default

template-computo-R.qmd

Lines changed: 5 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
## About this document
44

5-
This document, accompanied with the [hopefully finely tuned git repos](https://github.com/computorg/template-computo-R/), provides a template for writing contributions to **Computo** [@computo]. We show how `R` code [@R-base] can be included and how the repository can be set up for triggering github actions for rendering the document, with dependencies handled by `renv`.
5+
This document, accompanied with the [tuned git repos](https://github.com/computorg/template-computo-R/), provides a template for writing contributions to **Computo** [@computo].
66

7-
## Setup a github repository for preparing your submission
8-
9-
You can start by clicking the **"use this template"** button, on the top of the page of the [github repository associated to this document](https://github.com/computorg/template-computo-R/). Of course, you can set your repository private during the preparation of your manuscript.
7+
::: {.callout-tip}
8+
## Note
9+
This document provides only the main steps and key formatting principles. For a detailed, step-by-step guide on preparing your article and submitting it to Computo, please consult the [guidelines for authors](https://computo-journal.org/site/guidelines-authors.html).
10+
:::
1011

1112
## Quarto
1213

@@ -22,14 +23,6 @@ quarto add computorg/computo-quarto-extension
2223

2324
[`R`](https://www.r-project.org/) and the following `R` packages must be installed on your computer: [`knitr`](https://cran.r-project.org/package=knitr), [`markdown`](https://cran.r-project.org/package=markdown).
2425

25-
## Link with your usual tools
26-
27-
Quarto is expecting a `.qmd` markdown file, but will also works with a standard [`Rmarkdown`](https://rmarkdown.rstudio.com/) (`.Rmd`) file. In addition, especially if you are not comfortable with the command line interface, quarto is fully integrated inside the [Rstudio IDE](https://quarto.org/docs/get-started/hello/rstudio.html) so that you can write and build your quarto document inside Rstudio.
28-
29-
Quarto can also process a [Jupyter notebook](https://quarto.org/docs/get-started/hello/jupyter.html) file if you are used to it (it will just require to add the proper YAML metadata^[the same metadata as in the [`template-computo-R.qmd` file](https://github.com/computorg/template-computo-R/blob/main/template-computo-R.qmd) in the first cell, type "Raw", of the notebook]).
30-
31-
**Note**: _More advanced Jupyter-related functionality like Myst/Jupyter book are not supported in this Quarto setup. The markdown syntax inside the Jupyter notebook should follow the Quarto syntax (c.f. [below](#formatting)). If you are more comfortable with using Myst/Jupyter book, we provide a [specific template](https://github.com/computorg/template-computo-myst) but it will requires more formatting work for Computo editorial team, thus highly encourage authors to use the Quarto templates._
32-
3326
# Formatting
3427

3528
This section covers basic formatting guidelines for quarto documents.
@@ -196,65 +189,6 @@ Advanced formatting features are possible and documented (including interactive
196189

197190
:::
198191

199-
# Finalize your submission
200-
201-
## Handle `R` dependencies with `renv`
202-
203-
To make your work reproducible, you need to fix the packages and environment used to run your analysis. For the `R` system, the `renv` package is one of the possible reliable method, supported by the community. You basically need a couple of commands to setup your environment on your local machine. First,
204-
205-
```{r, eval = FALSE}
206-
renv::init()
207-
```
208-
209-
will initialize your repository. Then you just need to install the dependencies required to run your contribution, for instance,
210-
211-
212-
```{r, eval=FALSE}
213-
renv::install("ggplot2") # or equivalently install.packages("ggplot2")
214-
```
215-
216-
Non-CRAN packages (*e.g.* Github packages) can be used. Once you are done, you can fix everything with the command
217-
218-
```{r, eval=FALSE}
219-
renv::snapshot()
220-
```
221-
222-
::: {.callout-important}
223-
The only file that needs to be versioned by git is `renv.lock`. By default, the rest is ignored thanks to `.gitignore`.
224-
:::
225-
226-
More details for using `renv` can be found either
227-
228-
- on the [`renv` packge webpage](https://rstudio.github.io/renv/articles/renv.html), or
229-
- on the [quarto page dedicated to environments](https://quarto.org/docs/projects/virtual-environments.html#using-renv)
230-
231-
## Continuous integration
232-
233-
The repository associated with this template is pre-configure to trigger an action on push that performs the following:
234-
235-
1. Check out repository on the `ubuntu-latest` machine
236-
2. Install quarto and dependencies, including the Computo extension
237-
3. Install R and dependencies with `renv`, using your `renv.lock` file
238-
4. Render your .qmd file and Publish the results on a gh-page (both HTML and PDF)
239-
240-
The file [.github/workflows/build.yml](https://github.com/computorg/template-computo-R/blob/main/.github/workflows/build.yml) is largely inspired from [this file](https://quarto.org/docs/publishing/github-pages.html#example-knitr-with-renv).
241-
242-
Once this is successful, you are ready to submit your manuscript to the [Computo submission platform](https://computo.scholasticahq.com/).
243-
244-
::: {.callout-warning}
245-
The first time, you possibly need to create the branch for the action to work. This can be done by running the following command from your computer, in your git repository:
246-
247-
```.bash
248-
quarto publish gh-pages
249-
```
250-
251-
Then, set the branch `gh-page` as the source of your github page, and trigger the action to check that everything works fine.
252-
:::
253-
254-
## Data and large files
255-
256-
If your submission materials contain files larger than 50MB, **especially data files**, they won’t fit on a git repository as is. For this reason, we encourage you to put your data or any materials you deem necessary on an external “open data” centered repository hub such a [Zenodo](https://zenodo.org/) or [OSF](https://osf.io/).
257-
258192
# References {.unnumbered}
259193

260194
::: {#refs}

0 commit comments

Comments
 (0)