rich-iannone / splitr

Use the HYSPLIT model from inside R and do more with it
Other
141 stars 60 forks source link

Write out fail for dispersion.csv on windows #22

Closed bhickson closed 4 years ago

bhickson commented 6 years ago

When attempting to create dispersion model as per sample instructions from README, write out fails with error...

Error in file(file, ifelse(append, "a", "w")) : cannot open the connection In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file '"C:/Users/myname/Documents/SplitR/disp--2018-07-12--15-41-50/dispersion.csv"': Invalid argument

Replacing line 815->817 in hysplit_dispersion.R with

write.table(disp_df, file = paste0(getwd(), "/", folder_name, "/dispersion.csv"), sep = ",", row.names = FALSE)

solved the issue. Just remove the escape characters and quotes in beginning and end of paste0.

Verified on two Windows 10 machines.

rich-iannone commented 5 years ago

Thanks for filing this issue. I will address this by using file.path(). I intend to refactor the hysplit_dispersion() function.

rich-iannone commented 4 years ago

This shouldn’t be a problem anymore given the recent changes to hysplit_dispersion().