Skip to content

Commit

Permalink
removed remaining moinput references
Browse files Browse the repository at this point in the history
  • Loading branch information
tscheypidi committed May 12, 2020
1 parent 3030f14 commit c782d60
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 750 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
carbon_stored.*
^\.git$
^\.travis.yml
^.*\.zenodo.json$
43 changes: 43 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"title": "mrland: MadRaT land data package",
"version": "0.0.2",
"description": "<p>The package provides land related data via the madrat framework.<\/p>",
"creators": [
{
"name": "Dietrich, Jan Philipp"
},
{
"name": "Mishra, Abhijeet"
},
{
"name": "Weindl, Isabelle"
},
{
"name": "Bodirsky, Benjamin Leon"
},
{
"name": "Wang, Xiaoxi"
},
{
"name": "Baumstark, Lavinia"
},
{
"name": "Kreidenweis, Ulrich"
},
{
"name": "Klein, David"
},
{
"name": "Steinmetz, Nele"
},
{
"name": "Chen, David"
},
{
"name": "Humpenoeder, Florian"
},
{
"name": "Wirth, Stephen"
}
]
}
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: mrland
Type: Package
Title: MadRaT land data package
Version: 0.0.1
Date: 2020-05-02
Version: 0.0.2
Date: 2020-05-12
Authors@R: c(person("Jan Philipp", "Dietrich", email = "[email protected]", role = c("aut","cre")),
person("Abhijeet", "Mishra", role = "aut"),
person("Isabelle", "Weindl", role = "aut"),
Expand Down Expand Up @@ -30,7 +30,7 @@ License: LGPL-3 | file LICENSE
LazyData: no
Encoding: UTF-8
RoxygenNote: 7.1.0
ValidationKey: 18384
ValidationKey: 36788
Suggests: knitr,
testthat,
rmarkdown,
Expand Down
3 changes: 1 addition & 2 deletions R/calcCalibrationDummy.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#' @importFrom magclass new.magpie

calcCalibrationDummy <- function() {
#data(moinput)
iso_country <- read.csv2(system.file("extdata","iso_country.csv",package = "moinput"),row.names=NULL)
iso_country <- read.csv2(system.file("extdata","iso_country.csv",package = "mrland"),row.names=NULL)
iso_country1<-as.vector(iso_country[,"x"])
names(iso_country1)<-iso_country[,"X"]
x <- new.magpie(cells_and_regions = iso_country1,years = NULL, names = c("crop","past"), fill = 1)
Expand Down
2 changes: 1 addition & 1 deletion R/calcEFch4AWMS.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ calcEFch4AWMS<-function(){
emis<-readSource("FAO","EmisAgManureManag")
ch4<-emis[,,c("Emissions_(CH4)_(Manure_management)_(Gigagrams)","Manure_(N_content)_(Manure_management)_(Kg)")]

map <- toolMappingFile(type = "sectoral",name="FAOitems_animals_ch4.csv",readcsv=TRUE, where = "moinput")
map <- toolMappingFile(type = "sectoral",name="FAOitems_animals_ch4.csv",readcsv=TRUE, where = "mrland")
ch4_ag <- toolAggregate(x = ch4,dim = 3.1,rel = map,from = "fao",to="magpie",partrel = TRUE, verbosity = 2)
ef <- collapseNames((ch4_ag[,,"Emissions_(CH4)_(Manure_management)_(Gigagrams)"]/1000)
/(ch4_ag[,,"Manure_(N_content)_(Manure_management)_(Kg)"]/1000000000))
Expand Down
3 changes: 1 addition & 2 deletions R/calcExoTcDummy.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#' @importFrom utils read.csv2

calcExoTcDummy <- function() {
#data(moinput)
iso_country <- read.csv2(system.file("extdata","iso_country.csv",package = "moinput"),row.names=NULL)
iso_country <- read.csv2(system.file("extdata","iso_country.csv",package = "mrland"),row.names=NULL)
iso_country1<-as.vector(iso_country[,"x"])
names(iso_country1)<-iso_country[,"X"]
x <- new.magpie(cells_and_regions = iso_country1,years = seq(1995,2150,by=5), names = NULL, fill = 0)
Expand Down
2 changes: 1 addition & 1 deletion R/calcTimberHarvestCost.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ calcTimberHarvestCost<-function(){

gtap <- readSource("GTAP","GTAP7_VFM",convert = F)
gtap_harv_forestry <- dimSums(collapseNames(gtap[,,"frs"][,,c("SkLab")]),dim=3) ##SkLab as proxy. Maybe not 100percent good proxy
map <- toolGetMapping("GTAP7Mapping2016.csv", type = "regional", where="moinput")
map <- toolGetMapping("GTAP7Mapping2016.csv", type = "regional", where="mrland")

out <- toolAggregate(gtap_harv_forestry, rel=map, from="Region.code", to="Country.code",
dim=1, partrel = TRUE, verbosity=2)
Expand Down
4 changes: 2 additions & 2 deletions R/convertGTAP.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ convertGTAP <- function(x,subtype) {

fao <- collapseNames(calcOutput("FAOmassbalance", aggregate = FALSE)[, 2005, "dm"])

region_mapping <- toolMappingFile("regional",paste0(gtap,"Mapping2016.csv"),readcsv = TRUE,where = "moinput")
sector_mapping <- toolMappingFile("sectoral","mappingGTAPMAgPIETrade.csv",readcsv = TRUE,where ="moinput")
region_mapping <- toolMappingFile("regional",paste0(gtap,"Mapping2016.csv"),readcsv = TRUE,where = "mrland")
sector_mapping <- toolMappingFile("sectoral","mappingGTAPMAgPIETrade.csv",readcsv = TRUE,where ="mrland")
sector_mapping <- sector_mapping[which(sector_mapping$gtap !="xxx" & sector_mapping$magpie !="zzz"),]
if (subtype %in% c("VIWS","VIMS","VXWD","VXMD")){
fao_import <- collapseNames(fao[, 2005, "import"])
Expand Down
2 changes: 1 addition & 1 deletion R/readFRA2015Doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
readFRA2015Doc <- function(subtype){

## Mapping file
iso_country <- read.csv2(system.file("extdata","FAOiso_faocode.csv",package = "moinput"),row.names=NULL)
iso_country <- read.csv2(system.file("extdata","FAOiso_faocode.csv",package = "mrland"),row.names=NULL)

## Original data file name
location <- "FRA2015_data.xlsx"
Expand Down
34 changes: 19 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# R mrland package
[![Travis build status](https://travis-ci.com/pik-piam/mrland.svg?branch=master)](https://travis-ci.com/pik-piam/mrland)


# MadRaT land data package
#### R package **mrland**, version **0.0.2**


## Purpose and Functionality

The R-library moinput provides useful functions and a common structure to all the input data required to run models like MAgPIE and REMIND
The package provides land related data via the madrat framework.


## Installation
Expand All @@ -29,20 +28,25 @@ Package updates can be installed using `update.packages` (make sure that the add
update.packages()
```

## Tutorial
## Questions / Problems

The package comes with a vignette describing the basic functionality of the package and how to use it. You can load it with the following command (the package needs to be installed):
In case of questions / problems please contact Jan Philipp Dietrich <[email protected]>.

```r
vignette("moinput")
```
## Citation

## Questions / Problems
To cite package **mrland** in publications use:

In case of questions / problems please contact Jan Dietrich <[email protected]>.
Dietrich J, Mishra A, Weindl I, Bodirsky B, Wang X, Baumstark L, Kreidenweis U, Klein D, Steinmetz N, Chen D,
Humpenoeder F, Wirth S (2020). _mrland: MadRaT land data package_. R package version 0.0.2.

## Citation
A BibTeX entry for LaTeX users is

```r
citation("mrland")
```latex
@Manual{,
title = {mrland: MadRaT land data package},
author = {Jan Philipp Dietrich and Abhijeet Mishra and Isabelle Weindl and Benjamin Leon Bodirsky and Xiaoxi Wang and Lavinia Baumstark and Ulrich Kreidenweis and David Klein and Nele Steinmetz and David Chen and Florian Humpenoeder and Stephen Wirth},
year = {2020},
note = {R package version 0.0.2},
}
```

4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(testthat)
library(moinput)
library(mrland)

test_check("moinput")
test_check("mrland")
113 changes: 0 additions & 113 deletions vignettes/moinput.R

This file was deleted.

Loading

0 comments on commit c782d60

Please sign in to comment.