Skip to content

Commit

Permalink
correct pseudo plot
Browse files Browse the repository at this point in the history
  • Loading branch information
akreutzmann committed Oct 25, 2023
1 parent 6b21763 commit c7b1e3d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ importFrom(ggplot2,geom_boxplot)
importFrom(ggplot2,geom_density)
importFrom(ggplot2,geom_line)
importFrom(ggplot2,geom_point)
importFrom(ggplot2,geom_polygon)
importFrom(ggplot2,geom_qq)
importFrom(ggplot2,geom_segment)
importFrom(ggplot2,geom_sf)
Expand Down
20 changes: 13 additions & 7 deletions R/map_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
#' }
#' @export
#' @importFrom reshape2 melt
#' @importFrom ggplot2 aes geom_sf facet_wrap coord_equal labs
#' @importFrom ggplot2 aes geom_polygon geom_sf facet_wrap coord_equal labs
#' @importFrom ggplot2 theme element_blank scale_fill_gradient ggplot ggtitle
#' @importFrom rlang .data

Expand Down Expand Up @@ -162,15 +162,21 @@ map_pseudo <- function(object, indicator, panelplot, MSE, CV) {

if (panelplot) {
ggplot(tplot, aes(x = x, y = y)) +
geom_sf(aes(group = id, fill = value)) +
facet_wrap(facets = ~ variable,
ncol = ceiling(sqrt(length(unique(tplot$variable))))
geom_polygon(aes(
group = id,
fill = value
)) +
facet_wrap(~variable,
ncol = ceiling(sqrt(length(unique(tplot$variable))))
)
} else {
for (ind in indicator) {
print(ggplot(tplot[tplot$variable == ind, ], aes(x = x, y = y)) +
ggtitle(paste0(ind)) +
geom_sf(aes(group = id, fill = value)))
print(print(ggplot(tplot[tplot$variable == ind, ], aes(x = x, y = y)) +
ggtitle(paste0(ind)) +
geom_polygon(aes(
group = id,
fill = value
))))
cat("Press [enter] to continue")
line <- readline()
}
Expand Down
6 changes: 0 additions & 6 deletions packrat/packrat.lock
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,6 @@ Source: CRAN
Version: 2.0.3
Hash: b323532bfd2fe948d0eb19afa866cb12

Package: maptools
Source: CRAN
Version: 1.1-4
Hash: a645bede230e2384acf227d55b270b77
Requires: sp

Package: memoise
Source: CRAN
Version: 2.0.1
Expand Down

0 comments on commit c7b1e3d

Please sign in to comment.