This project is useful to initiate a new Gitlab project containing a R package. (This can also be useful for simple R code project -not package- because this allow usage of devtools commands for tests, quality, etc.)
Prerequisites
Optional:
- TortoiseGit installed on Windows (download link). This will simplify some steps.
- Knowledge of Git and Gitlab (UREP docs : Git, Gitlab).
How to use
- Clone this project locally on your computer
- Create a new “empty project” (without README file) on the Forgemia (Gitlab) website. The project must be created at the right place in the groups and the right name, if you don’t know which group is appropriate, then ask Raphael Martin with an issue in Global issues or directly.
- Clone this new project locally on your computer
- Copy all files and folders (except
.git
folder) from the first clone into the second (which is empty except.git
folder) - You can remove the clone you done for this project, it is no longer useful.
- Select all copied files and folders and then use a right mouse click on them. In the displayed menu over
TortoiseGit
, and in the submenu selectAdd...
. - Commit this files, for that use a right mouse click on your base clone folder and select
Git Commit -> "main"...
. In the new window select in bottom right buttons select “Commit” (the button have an arrow to change the button action from “Commit & Push” to “Commit”). At this stage you have commit your changes in your local git repository, nothing is sent to Gitlab. - Follow instructions in
newProjectCommands.R
file to adjust the project to your needs… - Add file to git and commit again your changes. (see steps 6. and 7. for details)
- Push all your commits to Gitlab. For that use a right mouse click on them. In the displayed menu over
TortoiseGit
, and in the submenu selectPush...
, then validate the new window without changing anything. - Now you can work on your projects with the help of commands in
devCommands.R
.
Gitlab provide the possibility to add custom project templates for project creation. Unfortunately, this is a paid functionality, so we don’t have access to it.
Package management guidelines
Some web guidelines for R package can be found here:
- R Packages web book by Hadley Wickham and Jenny Bryan.
- Official R package documentation can be hard to understand for beginners.
- The devtools package documentation