Open file created by R in an external program
For an solution that naturally extends your attempts, you could use shell.exec.
Opens the specified file using the application specified in the Windows file associations.
ff <- paste0(tempfile(), ".txt")write.table(head(mtcars), file=ff)shell.exec(ff)
Created on 2020-03-11 by the reprex package (v0.3.0.9001)