Open CSV file in excel from R script
I have generated a csv file in R and would like my script to open this file in excel so that someone with no knowledge of R can modify the data. (Ideally when I run the script excel opens and loads this file). What is the best way to accomplish this?
cmdcommand to open an excel file is
open excel file.xlsx. In
Ryou can run the command line using
system. So putting these together:
excel_file_with_path <- "C:/Users/myusername/Documents/file.xlsx" command <- paste("open excel", excel_file_with_path) system(command)