Lets say I have the following script
k <- as.numeric(readline("Start Index: "))
tot <- NULL
for (i in 1:k){
tot <- c(tot, i)
}
write.csv(tot, "test.csv")
I would like to run this script from the command line. How can I run it so that it still asks for the user input (k
). Or otherwise can I add the value of k
in the CMD command as argument? I am on Linux.