Skip to content

Commit 56c68b4

Browse files
committed
Clean code and/or update documentation
1 parent 1c4eec7 commit 56c68b4

9 files changed

Lines changed: 21 additions & 32 deletions

R/add_logo.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ add_logo <- function(
7373
y_logo_inch_range <- x_logo_inch_range * logo_y_ratio
7474
y_logo_value_range <- y_logo_inch_range * y_values_per_inch
7575

76-
# x_logo_value_share <- x_logo_value_range / x_total_value_range
77-
# y_logo_value_share <- x_logo_value_share * logo_y_scale / device_y_scale
78-
# y_logo_value_range <- y_logo_value_share * y_total_value_range
79-
8076
if(position %in% c("bottomleft", "bottom", "bottomright")){
8177
ybottom <- par("usr")[3] + y_plot_value_range / 10 * indent
8278
ytop <- ybottom + y_logo_value_range

R/plot_empty_map.R

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
#' @param rivers List of data frames containing a river stretch (longitude and
77
#' latitude) and values to be plotted. Created by functions [load_rivers()] and
88
#' [extend_riverTable()]
9+
#' @param plot_map If TRUE a toner map is used as background
910
#'
10-
#' @param plot_toner If TRUE a toner map is used as background
1111
#' @importFrom grDevices png dev.off dev.new
12-
#'
1312
#' @importFrom graphics par
1413
#' @import ggmap
1514
#' @export
1615
#'
1716
plot_empty_map <- function(
18-
bbox = NULL, rivers = NULL, plot_toner = FALSE
17+
bbox = NULL, rivers = NULL, plot_map = FALSE
1918
){
19+
nTypes(reset = TRUE)
2020
if(is.null(bbox)){
2121
if(is.null(rivers)){
2222
stop("One of 'bbox' or 'rivers' must be passed to the function.")
@@ -45,7 +45,7 @@ plot_empty_map <- function(
4545
xlab = "", ylab = "",
4646
xlim = xlim, ylim = ylim)
4747

48-
if(plot_toner){
48+
if(plot_map){
4949
relWidth <- diff(par("plt")[c(1,2)])
5050
relHeight <- diff(par("plt")[c(3,4)])
5151
add_left <- par("plt")[1] / relWidth * par("cxy")[1]
@@ -57,12 +57,9 @@ plot_empty_map <- function(
5757
top = ylim[2] + add_top , bottom = ylim[1] - add_bottom)
5858
dev.new(noRStudioGD = TRUE, height = 6, width = 6 * width_factor,
5959
units = "in")
60-
t_map <- ggmap::get_stamenmap(bbox,maptype = "toner", zoom = 12)
60+
t_map <- ggmap::get_stadiamap(bbox, maptype = "stamen_toner", zoom = 12)
6161
ggmap::ggmap(ggmap = t_map, extent = "device")
6262

63-
# rect(xleft = xlim[2], xright = xlim[2] + add_right,
64-
# ybottom = ylim[1] - add_bottom, ytop = ylim[2] + add_top,
65-
# col = "white", xpd = TRUE)
6663
}
6764
}
6865

R/qsim_prepare.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#' @param flow_column_name,section_column_name String defining the column names.
1515
#' If NULL, the columns will be filled by NA values (flow column) or empty
1616
#' chracaters (section column)
17+
#' @param dec The decimal separator. If not "," (default) then usually ".".
1718
#'
1819
#' @details
1920
#' The flow column needs to be in m³/s
@@ -40,13 +41,14 @@ QSIM_prepare <-function(
4041
id_column_name = "ID",
4142
km_column_name = "km",
4243
flow_column_name = "Q",
43-
section_column_name = NULL
44+
section_column_name = NULL,
45+
dec = ","
4446
){
4547

4648
df_in <- data.table::fread(
4749
file = qsim_output_file,
4850
sep = ";",
49-
dec = ",",
51+
dec = dec,
5052
header = TRUE,
5153
colClasses = list(
5254
character = c(date_column_name, id_column_name)

man/Berlin_add_boarder.Rd

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/Berlin_add_catchments.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/Berlin_add_waterbodies.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/QSIM_prepare.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/add_districts.Rd

Lines changed: 0 additions & 11 deletions
This file was deleted.

man/plot_empty_map.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)