Can I run an .exe application and input interactive parameters in R?
I have an .exe file (it's a programme to analyse fossil pollen data [LRA] and isn't publically available) that I would like to run in R to automate it. There are several interactive parameters that the .exe needs to be given. E.g., when run in cmd, I have to manually type in the required files/answers. Some are .csv files containing lists of further .csv files to use, and others are numbers or letters, e.g. "1" or "N". It works fine manually in cmd but not in R.
I have tried using system(), system2(), processx() and shell(), e.g:
# Define the required inputs
inputs <- c("first.csv", "second.csv", 1, "N")
# Path to the executable
exe_path <- "path/to/executable.exe"
# Use system2 to run the executable with the input file
system2(exe_path, input = inputs)
Every time I get the same error, that the args/parameters are not being given so the application does not continue to run. I have tried multiple different versions of this from chat GPT and stack, but always run into the same issue.