Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
swatdoctr
Manage
Activity
Members
Labels
Plan
Issues
5
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph Schürz
swatdoctr
Commits
09026583
Commit
09026583
authored
2 years ago
by
Svajunas Plunge
Browse files
Options
Downloads
Patches
Plain Diff
title to plot_hru_pw_day
parent
1c244931
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/plot_hru_pw.R
+3
-2
3 additions, 2 deletions
R/plot_hru_pw.R
man/plot_hru_pw_day.Rd
+3
-1
3 additions, 1 deletion
man/plot_hru_pw_day.Rd
with
6 additions
and
3 deletions
R/plot_hru_pw.R
+
3
−
2
View file @
09026583
...
...
@@ -44,6 +44,7 @@ get_hru_id_by_attribute <- function(sim_verify, lum = NULL, mgt = NULL, soil = N
#' be set in \code{run_swat_verification()}
#' @param hru_id Numeric vector with HRU ids for which variables should be plotted
#' @param var Character vector that defines the variable names that are plotted
#' @param title Character for title to be put in the figure.
#' @param years Years of the simulated data for which varaibles are plotted.
#'
#' @importFrom dplyr filter mutate select %>%
...
...
@@ -56,7 +57,7 @@ get_hru_id_by_attribute <- function(sim_verify, lum = NULL, mgt = NULL, soil = N
#'
#' @export
#'
plot_hru_pw_day
<-
function
(
sim_verify
,
hru_id
,
var
,
years
=
1900
:
2100
)
{
plot_hru_pw_day
<-
function
(
sim_verify
,
hru_id
,
var
,
title
=
""
,
years
=
1900
:
2100
)
{
plot_data
<-
sim_verify
$
hru_pw_day
%>%
filter
(
unit
%in%
hru_id
)
%>%
filter
(
yr
%in%
years
)
%>%
...
...
@@ -67,7 +68,7 @@ plot_hru_pw_day <- function(sim_verify, hru_id, var, years = 1900:2100) {
ggplot
(
plot_data
)
+
geom_line
(
aes
(
x
=
date
,
y
=
value
,
color
=
unit
,
lty
=
unit
))
+
labs
(
x
=
'Date'
,
color
=
'HRU'
,
lty
=
'HRU'
)
+
labs
(
x
=
'Date'
,
color
=
'HRU'
,
lty
=
'HRU'
,
title
=
title
)
+
scale_x_date
(
date_labels
=
'%Y-%m-%d'
)
+
facet_grid
(
rows
=
vars
(
all_of
(
var
)),
scales
=
'free_y'
,
switch
=
'y'
)
+
theme_bw
()
+
...
...
This diff is collapsed.
Click to expand it.
man/plot_hru_pw_day.Rd
+
3
−
1
View file @
09026583
...
...
@@ -4,7 +4,7 @@
\alias{plot_hru_pw_day}
\title{Plot daily simulated variables which are saved in hru_pw_day}
\usage{
plot_hru_pw_day(sim_verify, hru_id, var, years = 1900:2100)
plot_hru_pw_day(sim_verify, hru_id, var,
title = "",
years = 1900:2100)
}
\arguments{
\item{sim_verify}{Simulation output of the function \code{run_swat_verification()}.
...
...
@@ -15,6 +15,8 @@ be set in \code{run_swat_verification()}}
\item{var}{Character vector that defines the variable names that are plotted}
\item{title}{Character for title to be put in the figure.}
\item{years}{Years of the simulated data for which varaibles are plotted.}
}
\value{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment