Skip to content

Commit

Permalink
fixed init and ref data plots
Browse files Browse the repository at this point in the history
  • Loading branch information
jcaracappa1 committed Jul 11, 2024
1 parent 55d9928 commit 78a476c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/compare_spatial_vars.R
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ compare_spatial_vars = function(param.dir,

#Get species data

#species ref box
ref.data.box =boxes %>%
left_join(filter(ref.data,species == spp.names[s]))

init.data.box = boxes %>%
left_join(filter(init.data,species == spp.names[s]))

plot.data.ls = list()
for(r in 1:length(run.names)){

Expand Down Expand Up @@ -172,7 +179,7 @@ compare_spatial_vars = function(param.dir,

plot.spp.ls = list()
#1: Maps of ref values
p1 = ggplot2::ggplot(dplyr::filter(plot.data,run.name == run.names[1]),ggplot2::aes(x = long,y = lat, group = polygon, fill = ref.value))+
p1 = ggplot2::ggplot(ref.data.box,ggplot2::aes(x= long, y = lat, group = polygon, fill = ref.value))+
ggplot2::geom_polygon(color = 'black')+
ggplot2::ggtitle('Reference Value')+
ggplot2::scale_fill_gradient(low = 'white',high = 'forestgreen',name = paste0('reference\n',data.type))+
Expand All @@ -182,7 +189,7 @@ compare_spatial_vars = function(param.dir,
)

#2: Map of init values
p2 = ggplot2::ggplot(dplyr::filter(plot.data,run.name == run.names[1]),ggplot2::aes(x = long,y = lat, group = polygon, fill = init.value))+
p2 = ggplot2::ggplot(init.data.box,ggplot2::aes(x = long,y = lat, group = polygon, fill = init.value))+
ggplot2::geom_polygon(color = 'black')+
ggplot2::ggtitle('Initial Conditions')+
ggplot2::scale_fill_gradient(low = 'white',high = 'forestgreen',name = paste0('initial\n',data.type))+
Expand Down

0 comments on commit 78a476c

Please sign in to comment.