-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
1,195 additions
and
1,234 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
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
#' Map layer: iso (contour) | ||
#' | ||
#' | ||
#' Map layer that draws iso (contour) lines. Stack of [tm_lines()] and [tm_labels_highlighted]. | ||
#' | ||
#' @param col Visual variable that determines the color of the lines | ||
#' @param text Visual variable that determines the text | ||
#' @param ... passed on to [tm_lines()] and [tm_labels_highlighted()]. For the text color and alpha transparency of the text labels, please use `text_col` and `text_alpha` instead of `col` and `col_alpha`. | ||
#' | ||
#' @param col `r .doc_vv("col")` | ||
#' @param text `r .doc_vv("text")` | ||
#' @param ... passed on to [tm_lines()] and [tm_labels_highlighted()]. For the text color and alpha transparency of the text labels, please use `text_col` and `text_alpha` instead of `col` and `col_alpha`. | ||
#' @param options_lines The options for [tm_lines()] | ||
#' @param options_labels The options for [tm_labels_highlighted()] | ||
#' @export | ||
tm_iso = function(col, text, ..., options_lines = opt_tm_lines(), options_labels = opt_tm_labels()) { | ||
args = list(...) | ||
args$options = NULL | ||
argsL = args[intersect(names(formals("tm_lines")), names(args))] | ||
|
||
nms_col = c("col", "col.scale", "col.legend", "col.chart", "col.free", "col_alpha", "col_alpha.scale", "col_alpha.legend", "col_alpha.chart", "col_alpha.free") | ||
|
||
# update args for labels | ||
args[nms_col] = NULL | ||
rename_id = names(args) %in% paste0("text_", nms_col) | ||
|
||
names(args)[rename_id] = substr(names(args)[rename_id], 6, nchar(names(args)[rename_id])) | ||
argsT = args[intersect(names(formals("tm_labels_highlighted")), names(args))] | ||
|
||
do.call("tm_lines", c(list(col=col, options = options_lines), argsL)) + | ||
do.call("tm_labels_highlighted", c(list(text=text, options = options_labels), argsT)) | ||
} |
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
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
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
Oops, something went wrong.