-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
121 lines (83 loc) · 5.03 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Key IMPACT R-Archive Network (KIRAN)
### Status
<!-- badges: start -->
[![:name status badge](https://ifpri.r-universe.dev/badges/:name)](https://ifpri.r-universe.dev)
[![:registry status badge](https://ifpri.r-universe.dev/badges/:registry)](https://ifpri.r-universe.dev)
[![KIRAN status badge](https://ifpri.r-universe.dev/badges/KIRAN)](https://ifpri.r-universe.dev)
[![R-CMD-check](https://github.com/IFPRI/KIRAN/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/IFPRI/KIRAN/actions/workflows/R-CMD-check.yaml)
[![license](https://img.shields.io/badge/Licence-GPL%20(%3E%3D%203)-red)](https://github.com/IFPRI/KIRAN/blob/master/LICENSE.md)
<!-- badges: end -->
## Purpose
This R package automates installation for some of the R packages needed for
the functioning of R based data processing and visualization tools developed for
the International Model for Policy Analysis of Agricultural Commodities and
Trade (IMPACT) model.
The IMPACT model was developed in the early 1990s to explore the long term
challenges facing policymakers in reducing hunger and poverty in a sustainable
fashion. The IMPACT model has been expanded and improved repeatedly to respond
to increasingly complex policy questions and the state-of-the-art of modeling.
[See documentation of most recent update](http://www.ifpri.org/publication/international-model-policy-analysis-agricultural-commodities-and-trade-impact-model-0).
## Background
Using the package described here, we will establish the KIRAN suite of R based
packages. KIRAN stands for *Key IMPACT R-Archive Network* akin to Comprehensive
R Archive Network (CRAN) which acts as a default repository for many of the R
packages.
The goal of this is to to be able to automate the installation process for the
three major libraries which make up the KIRAN suite of packages developed by the
Foresight and Policy Modeling unit of IFPRI.
## Prerequisites:
1. [Base R installation](https://cloud.r-project.org/). Please use v4.2.3 or greater (whichever is the latest stable release in case you
are installing it for the first time)
2. [R studio installation available from Posit](https://posit.co/download/rstudio-desktop/)
3. [Rtools installation (on Windows. Not needed on Mac/Linux)](https://cran.r-project.org/bin/windows/Rtools/) - please check for the correct Rtools version based on your base R installation from either step 1 or your existing R installation
4. If you prefer a command prompt interface – please add R executable to your environment variables on Windows based machines.
## Installing `KIRAN` package
The `KIRAN` package can be easily installed from IFPRI's R-Universe. To do so,
open a new session of R or R-Studio from your R/R-Studio installations, and paste
the following command on the "Console" of your R/R-Studio session and press enter.
```{r, eval=FALSE}
# Installing from r-universe of IFPRI
install.packages('KIRAN',
repos='http://https://ifpri.r-universe.dev/',
dependencies = TRUE)
```
Please play close attention to your screen, R/R-Studio might generate some pop-up
windows which might not automatically appear on top of yor screen.
Check the task bar on windows machines for any app symbol which might be "blinking".
The same might apply to linux based machines.
Usually, R can do the following once you execute the above command in the form of pop-ups:
- Ask you to choose a default CRAN repository. Choose 0, or location closest to you.
- Ask you to restart your R session. Choose Yes if prompted
## In case of no "errors" during `KIRAN` installation
In case no substantial errors were encountered during the previous step, we can proceed further.
Go back to your R/R-Studio session and type the following and press enter
```{r, eval=FALSE}
library(KIRAN)
setKiran()
```
The command above attempts to install all the packages needed for the correct
functioning of the R-based libraries which make up the KIRAN suite of packages.
The workflow of the above command is as follows:
1. Installs core R packages which are needed to facilitate the data transfer between GAMS and R
2. Installation of `devtools`
3. Installation of `magclass` for array based operations
4. Detection of `GAMS` installation
5. Automatic installation of `gamstransfer` package
6. Setting up the KIRAN suite of packages (`DOORMAT`, `reportIMPACT`, `ARIA`)
Once again, please play close attention to your screen, R/R-Studio might generate
some pop-up windows which might not automatically appear on top of your screen.
There might even be errors or warnings shown on your R/R-Studio console. Usually these errors or warnings are self-explanatory. In case you are not successful in fixing these errors/warnings, see last section of this document.
## Questions / problems
In case of questions / problems please contact Abhijeet Mishra (A.Mishra@cgiar.org)