My function is:
create_matrix <- function() {
cat("Write the numbers of vertices: ")
user_input <- readLines("stdin", n=1)
user_input <- as.numeric(user_input)
print(user_input)
}
With the version 3.5.0, after i entered the data the program doesn't continue the execution. I'm calling the script directly from the console.
data = readLines(n=1)
? – Pollyhelp("showConnections")
might be relevant: " GUI consoles (which may not have an active ‘stdin’, and if they do it may not be connected to console input)". – Pollystdin
so you may be hitting that. – Wealdstdin()
{much more expressive anyway}, does work in all versions of R (see my A below). – Reviviscence