Hello @bryanrt ,
I think that readr::write with only append=T or append=F should be sufficient.
Why your file.exists logic does not handle that correctly, I do not know.
Some suggestions in case of further questions from your site:
- please use a minimal (not-) working example of your problem: reprex so that we can redo the relevant part of your code
- don't repeat code when not necessary: use a function for the tests on NULL
(Are you sure that those fields really contain the charactersNULL?)
There are constructions in dplyr to apply this function to all or a selection of the table columns e.g.across - Assign the result of
here::here("NMTSO_meta.csv")to a variable and reuse this variable