From r@lf@@tubner @ending from d@q@n@@com  Fri May 25 19:18:58 2018
From: r@lf@@tubner @ending from d@q@n@@com (Ralf Stubner)
Date: Fri, 25 May 2018 19:18:58 +0200
Subject: [Rd] readLines function with R >= 3.5.0
Message-ID: <32da856c-a60a-974f-65ab-d7123e12e813@daqana.com>

Dear all,

I would like to draw you attention to this question on SO:
https://stackoverflow.com/questions/50372043/readlines-function-with-new-version-of-r

Based on the OP's code I used the script

#######################################
create_matrix <- function() {
  cat("Write the numbers of vertices: ")
  user_input <- readLines("stdin", n=1)
  user_input <- as.numeric(user_input)
  print(user_input)
  }
create_matrix()
#######################################

and called it with "R -f ..." from the command line.

With 'R version 3.4.4 (2018-03-15) -- "Someone to Lean On"' the script
prints the inputed number as expected. With both 'R version 3.5.0
(2018-04-23) -- "Joy in Playing"' and 'R Under development (unstable)
(2018-05-19 r74746) -- "Unsuffered Consequences"' the script does not
continue after inputing a number.

All these tests where done using docker images from the rocker project,
i.e. effectively using Debian Linux.

Is this an error in the script or in R?

Thanks
Ralf

-- 
Ralf Stubner
Senior Software Engineer / Trainer

daqana GmbH
Dortustra?e 48
14467 Potsdam

T: +49 331 23 61 93 11
F: +49 331 23 61 93 90
M: +49 162 20 91 196
Mail: ralf.stubner at daqana.com

Sitz: Potsdam
Register: AG Potsdam HRB 27966 P
Ust.-IdNr.: DE300072622
Gesch?ftsf?hrer: Prof. Dr. Dr. Karl-Kuno Kunze



[Rd] readLines function with R >= 3.5.0
Ralf Stubner