The cause is likely the fact that the user was using a network drive, and the network drive became unavailable to R for a fraction of a second, i.e. bad luck.
call_stata_script should be made more robust. Actually changing the R working directory is more of a hack than a solution in the first place, so preferably the need for doing it would be removed. An additional hack could be trying e.g. 10 times over 10 seconds to change the working directory --- this would protect against temporary network drive unavailability to some extent at least.
To be clear, the working directory is changed two times within that function, and both instances should be either removed or made into a more robust hack.
A NORDCAN participant just had the error
while computing survival. This comes from
https://github.com/CancerRegistryOfNorway/nordcansurvival/blob/79957e431e6ab309d6f615b43a0118920e0e9be1/R/utils.R#L30
The cause is likely the fact that the user was using a network drive, and the network drive became unavailable to R for a fraction of a second, i.e. bad luck.
call_stata_script
should be made more robust. Actually changing the R working directory is more of a hack than a solution in the first place, so preferably the need for doing it would be removed. An additional hack could be trying e.g. 10 times over 10 seconds to change the working directory --- this would protect against temporary network drive unavailability to some extent at least.To be clear, the working directory is changed two times within that function, and both instances should be either removed or made into a more robust hack.