This is windows 10 context. R Script (as function) listens to some realtime data and then is supposed to play an audible alarm once some level is tripped. The alarm is activated by a separate function call, and that function simply plays an mp3 file which I play via the following
command: system("powershell.exe", input="C:/Users/ThisUser/Music/Alarms/alarm_alarm_alarm2.mp3").
Additional background is that I'm typically running 3 (or more) other rstudio sessions on the machine. This is the error:
Error in file(con, "w") : cannot open the connection In addition: Warning messages:
1: package ‘httpuv’ was built under R version 3.4.1
2: In file(con, "w") :
cannot open file 'C:\Users\ThisUser\AppData\Local\Temp\Rtmp9w7SM3\file44982a915cf4': No such file or directory
I can test that system command from the console in another rstudio session and it works fine, but if I test in the console of the session where the error resides, I continue to get the error. Also, when I check the tempdir this is what I get:
tempdir() [1] "C:\Users\ThisUser\AppData\Local\Temp\Rtmp9w7SM3"
Are my other sessions messing up the Temp files or directory path? How can I fix? Thank you.