Skip to content

Commit

Permalink
move outdated rworldmap to suggests
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Jun 6, 2024
1 parent 40d0c44 commit d76c4de
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '7948400'
ValidationKey: '7971479'
AutocreateReadme: yes
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ cff-version: 1.2.0
message: If you use this software, please cite it using the metadata from this file.
type: software
title: 'luplot: Landuse Plot Library'
version: 4.0.0
date-released: '2024-05-28'
version: 4.0.1
date-released: '2024-06-05'
abstract: Some useful functions to plot data such as a map plot function for MAgPIE
objects.
authors:
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: luplot
Title: Landuse Plot Library
Version: 4.0.0
Date: 2024-05-28
Version: 4.0.1
Date: 2024-06-05
Authors@R: c(
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")),
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"),
Expand Down Expand Up @@ -37,10 +37,10 @@ Imports:
quitte,
RColorBrewer,
reshape2,
rworldmap (>= 1.3.8),
utils
Suggests:
covr
covr,
rworldmap (>= 1.3.8)
Encoding: UTF-8
LazyData: no
RoxygenNote: 7.3.1
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ importFrom(mip,plotstyle)
importFrom(mstools,toolGetMappingCoord2Country)
importFrom(quitte,as.quitte)
importFrom(reshape2,melt)
importFrom(rworldmap,joinCountryData2Map)
importFrom(rworldmap,mapCountryData)
importFrom(stats,as.formula)
importFrom(stats,cor)
importFrom(stats,cor.test)
Expand Down
14 changes: 8 additions & 6 deletions R/plotcountrymap.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
#' }
#' @export
#'@importFrom magclass getYears getRegions
#'@importFrom rworldmap joinCountryData2Map mapCountryData
#'@importFrom utils methods

plotcountrymap<-function(x,hatching=FALSE,...) {
# require(methods)
if (! requireNamespace("rworldmap", quietly = TRUE)) {
stop("Package 'rworldmap' must be installed to use 'luplot::plotcountrymap()'.", call. = FALSE)
}
# require(methods)
namedim<-getNames(x)
if(is.null(namedim)){namedim=1}
year<-getYears(x)
Expand All @@ -45,14 +47,14 @@ plotcountrymap<-function(x,hatching=FALSE,...) {
DF <- data.frame(country = countries,namedim = values,hatching=as.vector(x[,year,2]))
dimnames(DF)[[2]][[2]] <- paste(namedim[1],substr(year,2,5))
dimnames(DF)[[2]][[3]] <- paste(namedim[2],substr(year,2,5))
mapobject <- joinCountryData2Map(DF, joinCode = "ISO3",nameJoinColumn = "country")
mapCountryData(mapobject, nameColumnToPlot = dimnames(DF)[[2]][[2]],nameColumnToHatch=dimnames(DF)[[2]][[3]],...)
mapobject <- rworldmap::joinCountryData2Map(DF, joinCode = "ISO3",nameJoinColumn = "country")
rworldmap::mapCountryData(mapobject, nameColumnToPlot = dimnames(DF)[[2]][[2]],nameColumnToHatch=dimnames(DF)[[2]][[3]],...)

} else{
DF <- data.frame(country = countries,namedim = values)
dimnames(DF)[[2]][[2]] <- paste(namedim,substr(year,2,5))
mapobject <- joinCountryData2Map(DF, joinCode = "ISO3",nameJoinColumn = "country")
mapCountryData(mapobject, nameColumnToPlot = dimnames(DF)[[2]][[2]],...)
mapobject <- rworldmap::joinCountryData2Map(DF, joinCode = "ISO3",nameJoinColumn = "country")
rworldmap::mapCountryData(mapobject, nameColumnToPlot = dimnames(DF)[[2]][[2]],...)

}

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Landuse Plot Library

R package **luplot**, version **4.0.0**
R package **luplot**, version **4.0.1**

[![CRAN status](https://www.r-pkg.org/badges/version/luplot)](https://cran.r-project.org/package=luplot) [![R build status](https://github.com/pik-piam/luplot/workflows/check/badge.svg)](https://github.com/pik-piam/luplot/actions) [![codecov](https://codecov.io/gh/pik-piam/luplot/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/luplot) [![r-universe](https://pik-piam.r-universe.dev/badges/luplot)](https://pik-piam.r-universe.dev/builds)

Expand Down Expand Up @@ -39,7 +39,7 @@ In case of questions / problems please contact Benjamin Bodirsky <bodirsky@pik-p

To cite package **luplot** in publications use:

Bodirsky B, Dietrich J, Krause M, Stevanovic M, Humpenoeder F, Weindl I, Baumstark L, Klein D, Rolinski S, Wang X, Chen D, Sauer P (2024). _luplot: Landuse Plot Library_. R package version 4.0.0, <https://github.com/pik-piam/luplot>.
Bodirsky B, Dietrich J, Krause M, Stevanovic M, Humpenoeder F, Weindl I, Baumstark L, Klein D, Rolinski S, Wang X, Chen D, Sauer P (2024). _luplot: Landuse Plot Library_. R package version 4.0.1, <URL: https://github.com/pik-piam/luplot>.

A BibTeX entry for LaTeX users is

Expand All @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is
title = {luplot: Landuse Plot Library},
author = {Benjamin Leon Bodirsky and Jan Philipp Dietrich and Michael Krause and Miodrag Stevanovic and Florian Humpenoeder and Isabelle Weindl and Lavinia Baumstark and David Klein and Susanne Rolinski and Xiaoxi Wang and David Chen and Pascal Sauer},
year = {2024},
note = {R package version 4.0.0},
note = {R package version 4.0.1},
url = {https://github.com/pik-piam/luplot},
}
```

0 comments on commit d76c4de

Please sign in to comment.