SWATdoctR error

47 views
Skip to first unread message

Kirsten Vernin

unread,
Feb 18, 2025, 9:18:47 PMFeb 18
to SWAT+ Editor
I would like to use the SWATtdoctR package to complete model verification for my model using SWAT+. However, I am unable to run the model simulation in R without getting the following error: 
Error in `map2_chr()`: ! Can't recycle `.x` (size 25) to match `.y` (size 24).

when I run the following code: sim_nostress <- run_swat_verification(project_path = "C:/SWAT/SWATPlus/Datasets/doublebayou/Scenarios/Default/TxtInOut",
                                      outputs=c("wb","mgt","plt"),nostress=1)

I'm using R version 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life" and made sure all of the required packages were loaded (SWATdoctR, dplyr, purrr, readr, tidyr). My file path is set to be the TextInOut file and it looks like run verify folder is created and populated. However because the object sim_nostress is not created, I'm unable to run the remainder of the functions. 

Has anyone else run into this error when using SWAT+ and SWATdoctR? 

Emil Wagner

unread,
Oct 6, 2025, 11:16:02 AM (9 days ago) Oct 6
to SWAT+ Editor

Hi, I ran into the same issue. Have you found a solution?

My guess is that the problem might be due to changes in the structure of the codes.bsn file in a  SWAT+ update, which could be why SWATdoctR is having trouble reading the file.

Reply all
Reply to author
Forward
0 new messages