If I understand you correctly, you want to substitute infile with the actual file path, correct?

There are multiple ways to do this:

infile <- "variable"
sprintf("You can put your %s here", infile)
#> [1] "You can put your variable here"
paste0("You can use paste0 to put your ", infile, " inside of a string")
#> [1] "You can use paste0 to put your variable inside of a string"
library(glue)
glue("You can also use `glue` library and put your {infile} like this")
#> You can also use `glue` library and put your variable like this

Thank you mishabalyasin brother.
I had tried the solutions suggested and they helped me. Finally ended up with manipulations in system2 command that help me writing some functions invoking executeable files.