R-Studio
clone
To clone the repository, just follow the steps below:
Open R Studio
Click on the file button at the top left of the window then on New project.. button as shown on the image below.
Click on git version control as shown on the image below.
In the new windows click on clone a project from Git repository. See the image below.
Specify the URL of the remote repository (your forked copy of Carob) and the communication protocol (use https).
Specify the name of the folder on your local machine where the repository will be downloaded into. If this option is not specified, Git will simply create a new folder named after the remote repository. To get the URL, go to your remote repository and follow the step below:
Now you have your local copy of carob and you can start contributing.
editor settings
Many Carob scripts (including drafts in scripts/_todo/) are indented with tabs. By default, RStudio converts tabs into spaces when editing or re-indenting code, which produces noisy diffs full of whitespace-only changes. Using spaces in your own code is fine, as long as existing tabs are not converted into spaces (or vice versa).
The repository includes a carob.Rproj file (with UseSpacesForTab: No) that configures this automatically when you open Carob as an RStudio project. If you also edit scripts outside the RStudio project, change the global RStudio setting:
Open the top menu bar and click Tools > Global Options.
Select Code from the left sidebar, then click the Editing tab.
Uncheck the box labeled Insert spaces for tab.
Click Apply and then OK.
pull
Before you do any work, you should check that your remote repo (your forked version on github) is not behind the main repo (carob-data/carob). If so, you should synchronize your github hosted clone with the main repo. Now you can “pull” the latest version to your local repo.
add
In RStudio, new or modified files are added (staged) by checking the box next to them in the Git pane before committing.
commit
When you make a commit, you must include a commit message that briefly describes the changes. The simplest way to commit your changes is by
clicking on Git, then on the Commit button at the top (right box) of the RStudio Graphical User Interface (GUI):
Select (check the box next to) the file(s) you want to commit in the box on the left of the window, then write your commit message in the new window and click on the Commit button (see the image below).
push
Once you have committed your change, you can now push the committed changes in your local repo to the remote repo of your fork.
By clicking on the Push button (the green up arrow), you will move your changes to your remote repository. We recommend using the RStudio GUI for new users. Once you are familiar with the process, you can choose the method that suits you best to push your changes.
Once the dataset is ready and your script is working, you can submit your contribution to the main Carob repository (carob-data/carob) by opening a pull request.