[R] SWATplusR package problems

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Tue Sep 7 14:51:12 CEST 2021


On 07/09/2021 7:00 a.m., Wray, Nicholas M via R-help wrote:
> 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 think you'll need to raise this as an "Issue" on that Github site; 
it's not really something we're likely to be able to help with (and is 
formally off-topic here, being a contributed package).

Duncan Murdoch

> 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
> 
> 
> library(SWATdata)
> library(SWATplusR)
> demo_path<-"C:Documents"
> demo_path
> ######
> path_plus <- load_demo(dataset = "project",
>                         version = "plus",
>                         path = demo_path,
>                         revision = 57)
> 
> 
> q_obs <- load_demo(dataset = "observation")
> q_obs
> 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_path
> riv_path
> library(sf)
> library(ggplot2)
> 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)) +
>    theme_bw()
> 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]]
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list