Please complete the following steps to setup the model:
- Setup an account on bitbucket.org
- Download and install R.
- (Recommended) Download and install RStudio.
- Download and install Git for version control.
- Download this shared Google Drive folder.
- Launch RStudio.
- From the menu, select File > New Project.
- In the dialogue menu that pops up, select Version Control.
- In the next menu select Git.
- Paste the repository URL from bitbucket.org into the Repository URL box. You can connect using either SSH or HTTPS.
- For HTTPS, use the link
https://wilkey@bitbucket.org/wilkey/ub_o-g_emissions.git
You'll be prompted for your username and password when you connect to the server. - For SSH, use the link
git@bitbucket.org:wilkey/ub_o-g_emissions.git
. Detailed instructions on SSH setup are available here. - A local copy of the server repository will be created by Git on your computer in a folder of your choice. The name of that folder will be whatever you enter in the Project directory name dialogue box (by default it's the same name as the bitbucket.org project name: ub_o-g_emissions). The folder will be located as a subdirectory of whatever folder you point to in the Create project as subdirectory of dialogue box. By default it's a subdirectory of ~/R, which is the R folder generated in your home directory when you first run R (or install any packages in R).
- After entering all the information, click the Create Project button.
- Open the script
main.R
, located in the local repository directory you created previously. This is the main script for the model. - Under the section of the scripts labeled
1.1 Paths
, change the paths for each of the directories listed to the location on your computer where you downloaded (a) the repository and (b) the shared Dropbox folder's contents. After altering the paths, save the script. - Download and install the packages necessary to run the model. A list of the packages used is given under the section header
1.3 Packages
. You can install packages using the commandinstall.packages("package_name")
in the R console. Alternatively, you can use the menu option Tools > Install Packages... and then enter the names of the packages you wish to install. - All modeling options are contained in the script
IO_options.R
, located in the local repository directory. Alter the input options as desired, and save the script. - You can now run the script using the menu option Code > Source or any of its keyboard shortcuts and variations.