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
cc988cea
Unverified
Commit
cc988cea
authored
2 years ago
by
Moritz Shore
Browse files
Options
Downloads
Patches
Plain Diff
documentation changes
parent
877fbfa8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
R/run_soft_cal.R
+12
-9
12 additions, 9 deletions
R/run_soft_cal.R
with
12 additions
and
9 deletions
R/run_soft_cal.R
+
12
−
9
View file @
cc988cea
# to be done with the @ stuff
library
(
data.table
)
# fread
library
(
dplyr
)
# filter, %>%, slice, ranking/row_number
library
(
tidyr
)
# unite
# read the wb_aa file
basin_wb_aa
=
fread
(
"C:/Users/NIBIO/Documents/GitLab/optain-swat/SWAT_softcal/swatplus_rev60_demo/basin_wb_aa.txt"
,
fill
=
TRUE
)
# this will need to be determined / passed
PATH
=
"C:/Users/NIBIO/Documents/GitLab/optain-swat/SWAT_softcal/swatplus_rev60_demo/"
# read the wb_aa file from its PATH
basin_wb_aa
=
fread
(
paste0
(
PATH
,
"basin_wb_aa.txt"
),
fill
=
TRUE
)
# The following is only required due to the poor formatting of the SWAT output
# The following is only required due to the poor formatting of the
# SWAT output file...
# change the column names to those of the second row in the text file.
colnames
(
basin_wb_aa
)
<-
basin_wb_aa
%>%
slice
(
2
)
%>%
unlist
(
.
,
use.names
=
F
)
# add placeholder names for the last three columns which did not get a name
colnames
(
basin_wb_aa
)[
c
(
47
:
49
)]
<-
c
(
"x"
,
"y"
,
"z"
)
# remove rows 1 to 3, as they dont contain any real data
# remove rows 1 to 3, as they don't contain any real data
basin_wb_aa
<-
basin_wb_aa
%>%
filter
(
!
row_number
()
%in%
c
(
1
:
3
))
# Unite the last three rows into one string (as they were intended to be)
# the new column will be named description and describes what the softcal
# algorithm did in that step. (So its probably important).
...
...
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