This template is licensed under the Creative Commons Attribution 4.0 International license. Please see the license file.
When using this template, please don’t forget to:
-
Adapt this license section to your own needs
-
License your own content, and remember that open is better.
-
Link to the original license and give appropriate credit; please do so by including the following in the “License” section of the README.md file in your own project:
This project makes use of the rproj-template Github template created by Daniel Morillo and licensed under the Creative Commons Attribution 4.0 International license.
-
Click on the Green "Use this template" button on the top right corner.
-
In the drop-down menu, click on "Create a new repository".
-
In the "Create a new repository" page, fill in the field "Repository name" with a short name that represents the project you want to create.
-
Optionally, add a free text description in the "Description" field, and change the visibility to "Private" if you do not want to make it freely accessible on the internet.
-
Click on "Create repository".
-
Follow the instructions in the next section to install (i.e. clone) your repository locally.
To clone your repository locally, follow these
instructions
(steps 2 through 7). This will create a local copy of ('clone') the GitHub
repository as an Rstudio project in the folder specified. The URL that must be
entered into the Repository URL
text box will be of the form
https://github.com/<username>/<project-name>
where <username>
is your GitHub user name, and <project-name>
is the value
you input before in the "Repository name" field in step 3.
IMPORTANT: It is totally unrecommended to clone a git repository inside a
cloud storage folder (e.g., Dropbox, OneDrive). Please note that GitHub serves
the purpose of backing up the repository, so no cloud storage is necessary.
Similarly, cloning the repository in a network folder may cause problems with
the renv
environment (see below); do it at your own risk!
After cloning the repository, the Rstudio project will open automatically in the
Rstudio IDE. If it doesn't, or you want to return later to the project in
Rstudio, you can do so by double clicking on the file rstudio_project.Rproj
that has been created in the project folder when cloning the repository.
The reproducible environment created by renv
must be restored to install all
the packages this project needs to be built properly. If renv
does not
initialize automatically (check the console for messages about this), you will
need to manually install the package first:
install.packages("renv")
Once it is successfully installed, use the "renv" -> "Restore library..." button in Rstudio's "Packages" tab to restore the environment. Alternatively, you can type in the console:
renv::restore(prompt = FALSE)
This template provides the "README.Rmd" Rmarkdown file to facilitate creating your own "README.md" file. To use it, follow these instructions:
-
Open file "README.Rmd" in the Rstudio editor
-
Substitute the values of the objects
REPOSITORY_NAME
in line 12 andGITHUB_USERNAME
in line 16 by your repository name and your GitHub user name, respectively. -
Add a free text repository description (line 22), to help other people understand the purpose of your project. This can be the same text you input previously in the "Description" field when creating your repository (see step 4 in the "How to use this template" main section), or a more detailed one.
-
If necessary, choose a license and update the "License" section. If you do so, remember to substitute the license file by your own license.
-
In section "Attributions", add any additional attributions to software components you will use in your project.
-
Knit the "README.Rmd" file.(*)
-
Commit (i.e.,
git commit
) the changes to "README.md" and push (git push
) them to your GitHub repository.
(*) Please take into account that knitting "README.Rmd" will output a new "README.md" file, overwriting this one.