Menu

readline() sent from Tinn-R to Rterm not work

Help
2009-03-19
2012-09-25
  • Farrel Buchinsky

    I just discovered readline to provide user input. It is working as one
    would expect in Rgui but not in Rterm. In Rterm it reads the entire
    line of code not just the user input. How do I fix and what is the
    issue that I should read about?

    Here is my two line script:
    ANSWER <- readline(prompt="Are you a satisfied R user? ")
    ANSWER

    So under RGUI one gets the following
    > ANSWER <- readline(prompt="Are you a satisfied R user? ")
    Are you a satisfied R user? yes {which I entered with my keyboard}
    > ANSWER
    [1] "yes"

    Under RTERM one gets
    > ANSWER <- readline(prompt="Are you a satisfied R user? ")yes
    Are you a satisfied R user?
    > ANSWER
    [1] "ANSWER <- readline(prompt=\&quot;Are you a satisfied R user? \&quot;)yes"

    So I tried to hit enter after I saw the line in the terminal and this
    is what I got:

    > ANSWER <- readline(prompt="Are you a satisfied R user? ")
    Are you a satisfied R user?
    > ANSWER
    [1] "ANSWER <- readline(prompt=\&quot;Are you a satisfied R user? \&quot;)"

    My R environment: Windows XP with service pack 3; R 2.8.1, tinn-R 2.2.0.2

     
    • jcfaria

      jcfaria - 2009-03-19

      Hello,

      It is really a bug with the Rterm interface!
      The function "scan" also is not working properly in this interface.

      We will try to fix it in the future!

      All the best,
      JCFaria

       

Log in to post a comment.