[R] SWATplusR package problems

Wray, Nicholas M nmw2000 @end|ng |rom hw@@c@uk
Tue Sep 7 13:00:21 CEST 2021

I am trying to get to grips with the SWAT+ hydrological model and with the package SWATplusR which is meant instantiate SWAT+ into R. I have going through the code supplied on this website https://github.com/chrisschuerz/SWATplusR/blob/master/vignettes/SWATplusR.Rmd

I can get so far, as shown beneath but then I get the error message also shown. I cannot see how to get any further

path_plus <- load_demo(dataset = "project",
                       version = "plus",
                       path = demo_path,
                       revision = 57)

q_obs <- load_demo(dataset = "observation")
plot(q_obs, type = "l")####### Path to the subbasin shape file
sub_path <- load_demo(dataset = "subbasin", version = "plus")# Path to the subbasin shape file
riv_path <- load_demo(dataset = "river", version = "plus")
sub <- read_sf(sub_path)
riv <- read_sf(riv_path)
ggplot() +
  geom_sf(data = sub) +
  geom_sf(data = riv, col = "royalblue", lwd = 0.75) +
  geom_sf_label(data = riv, aes(label = Channel)) +
q_sim_plus <- run_swatplus(project_path = path_plus,
                           output = define_output(file = "channel",
                                                  variable = "flo_out",
                                                  unit = 1))

The ggplot gives me a map but for the next line I get this error message:

Error: 'C:/swat_demo/swatplus_rev57_demo/time.sim' does not exist.

Where might this file be? I've tried searching for sources but cannot find anything. Thanks Nick Wray


Founded in 1821, Heriot-Watt is a leader in ideas and solutions. With campuses and students across the entire globe we span the world, delivering innovation and educational excellence in business, engineering, design and the physical, social and life sciences. This email is generated from the Heriot-Watt University Group, which includes:

  1.  Heriot-Watt University, a Scottish charity registered under number SC000278
  2.  Heriot- Watt Services Limited (Oriam), Scotland's national performance centre for sport. Heriot-Watt Services Limited is a private limited company registered is Scotland with registered number SC271030 and registered office at Research & Enterprise Services Heriot-Watt University, Riccarton, Edinburgh, EH14 4AS.

The contents (including any attachments) are confidential. If you are not the intended recipient of this e-mail, any disclosure, copying, distribution or use of its contents is strictly prohibited, and you should please notify the sender immediately and then delete it (including any attachments) from your system.

	[[alternative HTML version deleted]]

More information about the R-help mailing list