-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint signatures of currently unused funcs
- Loading branch information
1 parent
c279cdb
commit c2ed894
Showing
11 changed files
with
121 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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.1 | ||
date-released: '2024-05-27' | ||
version: 4.0.0 | ||
date-released: '2024-05-28' | ||
abstract: Some useful functions to plot data such as a map plot function for MAgPIE | ||
objects. | ||
authors: | ||
|
@@ -40,6 +40,9 @@ authors: | |
- family-names: Chen | ||
given-names: David | ||
email: [email protected] | ||
- family-names: Sauer | ||
given-names: Pascal | ||
email: [email protected] | ||
license: LGPL-3.0 | ||
repository-code: https://github.com/pik-piam/luplot | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.1 | ||
Date: 2024-05-27 | ||
Version: 4.0.0 | ||
Date: 2024-05-28 | ||
Authors@R: c( | ||
person("Benjamin Leon", "Bodirsky", , "[email protected]", role = c("aut", "cre")), | ||
person("Jan Philipp", "Dietrich", , "[email protected]", role = "aut"), | ||
|
@@ -14,7 +14,8 @@ Authors@R: c( | |
person("David", "Klein", , "[email protected]", role = "aut"), | ||
person("Susanne", "Rolinski", , "[email protected]", role = "aut"), | ||
person("Xiaoxi", "Wang", , "[email protected]", role = "aut"), | ||
person("David", "Chen", , "[email protected]", role = "aut") | ||
person("David", "Chen", , "[email protected]", role = "aut"), | ||
person("Pascal", "Sauer", , "[email protected]", role = "aut") | ||
) | ||
Maintainer: Benjamin Bodirsky <[email protected]> | ||
Description: Some useful functions to plot data such as a map plot | ||
|
@@ -30,13 +31,13 @@ Imports: | |
graphics, | ||
grDevices, | ||
gridExtra, | ||
lusweave, | ||
mip, | ||
mstools (>= 0.6.0), | ||
quitte, | ||
RColorBrewer, | ||
reshape2, | ||
rworldmap (>= 1.3.8), | ||
lusweave, | ||
utils | ||
Suggests: | ||
covr | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#' Creates bar plot to display given colors | ||
#' | ||
#' For a quick translation of hexadecimal color codes into visible colors this | ||
#' function simply creates a bar plot with the hexadecimal colors specified by | ||
#' the user. It takes a vector of strings containing the hexadecimal color | ||
#' codes, e.g. "#D0DD1E". | ||
#' | ||
#' @usage showcolors(...) | ||
#' @param ... One ore more strings or a vector of strings containing | ||
#' hexadecimal color codes. | ||
#' @author David Klein | ||
#' @examples | ||
#' | ||
#' \dontrun{showcolors("#D0DD1E")} | ||
#' \dontrun{showcolors("#beefee")} | ||
#' \dontrun{showcolors(c("#beefee","#D0DD1E"),"#FFFFFF")} | ||
#' @importFrom ggplot2 coord_flip | ||
#' @export | ||
showcolors <- function(...) { | ||
colors <- c(...) | ||
labels <- colors | ||
# if ... is a named vector add names to the labels | ||
if(!is.null(names(colors))) labels <- paste(names(colors),colors,sep="\n") | ||
# create data frame | ||
df<-data.frame(x=labels, c=colors) | ||
# prevent ggplot from sorting it alphabetically by giving order explicitly here | ||
# using original order of rownames. Reversing it because the bar plot reverses it again | ||
# To yield the correct mapping between colors and labels the colors have to be also reversed | ||
df$x<-factor(df$x,levels=rev(labels)) | ||
# create bar plot | ||
p1 <- ggplot(data=df, aes_string(x="x")) + geom_bar(fill=rev(df$c)) + coord_flip() + theme(axis.title.x = element_blank(),axis.title.y = element_blank()) | ||
#print(p1) | ||
return(p1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.