I am running an R script with thousands of lines that I want to run at once. In few of the lines while running the script, I want the running to pause to take input but that is not the case. When I ran the line of code below in isolation, there was a prompt to take input (i.e. 2024-07-01
) :
key_date <- readline(prompt = "Enter date keys were received (i.e. 2024-07-01) and press enter: ")
And later run:
key_date <- as.Date(key_date)
FileName <- paste0(hpi_key_date, ".xlsx")
I got the desired result: i.e. "2024-07-01.xlsx"
But when I ran:
key_date <- readline(prompt = "Enter date keys were received (i.e. 2024-07-01) and press enter: ")
key_date <- as.Date(key_date)
FileName <- paste0(hpi_key_date, ".xlsx")
there was no prompt for user to take input, and this gives a misleading object value afterwards (i.e "hpi_key_date <- as.Date(key_date).xlsx"
) instead of the desired "2024-07-01.xlsx"
when I run FileName
Any help will be appreciated.