Skip to content

Commit

Permalink
added plot switch for fwoxy func
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Nov 4, 2021
1 parent 75c77d7 commit 8c49e22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions R/fwoxy.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@
#' @param wspd_in numeric for windspeed at 10 m, m/s
#' @param agas_param numeric for the a coefficient, passed to \code{\link{fun_gas_transfer_velocity}}
#' @param gas_inv numeric for the inverse exponent function, passed to \code{\link{fun_gas_transfer_velocity}}
#' @param plot logical if plot is printed in addition to results data frame
#'
#' @import ggplot2
#' @import lattice
#' @import patchwork
#' @import tidyr
#'
#' @return 2 plots and a data frame
#' @return 2 plots and a data frame if \code{plot = TRUE}, otherwise just a data frame
#' @export
#'
fwoxy <- function(oxy_ic = oxy_ic, a_param = a_param, er_param = er_param, ht_in = ht_const,
salt_in = salt_const, temp_in = temp_const, wspd_in = wspd_const,
agas_param = 0.251, gas_inv = -0.5)
agas_param = 0.251, gas_inv = -0.5, plot = TRUE)
{

# Setting Parameters ------------------------------------------------------
Expand Down Expand Up @@ -203,7 +204,9 @@ fluxPlot <- ggplot(resultsNew, aes(x = t, y = Value, group = Variables, color =
scale_x_continuous(breaks = breaks, labels = labels)

p <- oxyPlot + fluxPlot + plot_layout(ncol = 1)
print(p)

if(plot)
print(p)
#print(fluxPlot)


Expand Down
7 changes: 5 additions & 2 deletions man/fwoxy.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8c49e22

Please sign in to comment.