Displaying 20 results from an estimated 20000 matches similar to: "Wait for user input with readline()"
2010 Nov 22
4
Wait for user input with readline()
Hello,
I am trying write a script that includes a prompt for user input using
readlines() and was told that folks at R-devel might be able to help.
I am running into the problem that when I run readlines() as a single line
the prompt works perfectly, but when I try to run a block of code which
includes the readline function, the script doesn't wait for the user input.
I have seen this
2007 May 23
1
Readline - wait for user input
Hi,
I've seen various posts on this question, but still can't get the code
right.
If I run the following code one line at a time, it works fine. If I run
it together as a block, however, it doesn't wait for the input and gives
an error.
There must be a way to have are pause/wait for an answer, but I can't
seem to find it. Thanks! J
Code:
choosefunction <-
2006 Jan 08
4
repeat { readline() }
Hi.
Using Rterm v2.2.1 on WinXP, is there a way to interrupt a call like
repeat { readline() }
without killing the Command window? Ctrl+C is not interrupting the loop:
R : Copyright 2006, The R Foundation for Statistical Computing
Version 2.2.1 Patched (2006-01-01 r36947)
<snip></snip>
> repeat { readline() }
^C
^C
^C
^C
On Unix it works. The problem seems to get the
2011 Oct 21
2
Calculating difference between values in data frame based on separate column
Hi all,
Say I have a data frame something like the one below with different sample
vials, measured before(B) and after(A) some process, with a value recorded
at each measurement point
vial measure value
1 B 26
1 A 12
2 B 45
2 A 30
3 B 32
3 A 27
4 B
2013 Sep 15
1
Executing a code until a new user input aborts it (readlines?)
Hi,
I know that with readlines you can start executing a code upon user input.
What I would like to do is to have the ability to abort a code based on a
new user input. E.g. when the user hits enter the code stops running. That
is, I would periodically check for a user input and stop the code when the
correct input was entered.
Below is an example of a function which would run an endless loop
2009 Oct 28
2
Re ading user input (Readline)
Hello. I am trying to write an interactive function that asks the user for a
vector of observations. Unfortunately, if a user inputs a vector, R treats
the vector name as a string instead of a variable. Here is an example:
vector.input<-function(){
k<-as.integer(readline("Input number of vectors: "))
obs<-as.integer(readline("Input number of observations per vector
2002 Nov 01
1
seemingly random "nesting of readline input" warnings
Recently, while using R-patched and now R-1.6.1 (on RedHat Linux 7.1) I've
been getting the following warning in the course of everyday activity:
[... some R activity ...]
In addition: Warning message:
An unusual circumstance has arisen in the nesting of readline input.
Please report using bug.report()
>
The warning is difficult to reproduce because it seems to appear at random
times,
2007 Jun 25
1
R behaviour related to user input (readline()) and run selection
When I run the below section of code I get the following error:
Error in if (co == "A" || co[1] == "O") { :
missing value where TRUE/FALSE needed
When I run the code in two parts where I first get the user's input
then afterwards run the if/else section, there is no problem.
Is there a way to stop the "run selection" process
2002 Nov 19
1
Nesting of readline input (PR#2310)
Hi everyone,
I am following instructions here as I have generated the following warning:
> # stuff looping through some plots with ask=TRUE
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
Hit <Return> to see next plot:
In addition: Warning message:
An unusual circumstance has arisen
2008 Apr 03
2
iterative loop with user input?
Hello R-Users,
I would like to use an iterative loop to collect user input from within a
function. I'm sure that this would be some combination of "for","break",
and "next" but have not been able to get the syntax down.
I would like to print some text to the screen at each step in the loop,
ask the user for input which is saved in an object, and then advance the
2011 Oct 03
2
file input with readLines
I am using readLines to read a fairly large ASCII file. readLines reads
a fixed number of lines, then other R code processes the data, then
readLines reads the same number of lines again, then other R code
processes the data, then ....
Sort of like:
conn<-file('filename','r')
for (chunk in 1:100000) {
Lines<-readLines(conn,n=25)
# process "Lines"
}
2018 May 26
2
Buffering in R 3.5 connections causes incorrect data in readChar
I noticed an issue where readChar does not return the correct value after a
call to readline. It appears that readChar is not aware of the buffering,
so it reads from the end of the buffer, rather than the current position in
the file. This is a significant change of behavior from R-3.4.4.
Below is a test case that I used to home in on the problem.
---
p<-"test2.txt"
2005 May 26
2
Reading text files and readLine
Hi,
I am trying to write a function to read in a whole text file as a single
string ( so I can calculate its "sha1" hash function using package
"digest"). I need a single string containing the whole file, and so far I
was using paste(readLines(fileName), collapse = ""). Unfortunately this
function gives me warnings :
incomplete final line found by readLines on
1999 Mar 25
4
readline() (PR#147)
Dear R developers,
I have found the following bug with readline() in R 0.63.3:
if you execute the menu-function and then the readline() function, then
readline() prompts "Selection:"
> a <- readline()
hello
> a
[1] "hallo"
> a <- menu(c("a", "b"), title="bitte:")
bitte:
1:a
2:b
Selection: 2
> a <- readline()
Selection:
2007 Jan 29
1
Problem with "readline" in compilatio of R for Solaris 11 (Nevada) in x86
Dear friends,
In configuring R 2.4.1 for Solaris 11, using SunStudio 11 compilers, I
get the following error.
checking readline/history.h usability... no
checking readline/history.h presence... no
checking for readline/history.h... no
checking readline/readline.h usability... no
checking readline/readline.h presence... no
checking for readline/readline.h... no
checking for rl_callback_read_char
2018 May 29
1
Buffering in R 3.5 connections causes incorrect data in readChar
Tomas,
Thank you for the explanation. I see in the documentation: "These functions
are intended to be used with binary-mode connections." So I see how using
it on a text connection is undefined, and not a bug. An error or warning
when attempting to use a it on a text connection would be helpful
considering how the behavior has changed in R-3.5.
On Tue, May 29, 2018 at 3:09 AM, Tomas
2011 Sep 07
2
ggplot2-Issue placing error bars behind data points
Hi all,
This seems like a basic problem, but no amount of playing with the code has
solved it. I have a time-series data set like that shown below (only longer)
and am seeking to plot the data with filled, circular points and error bars.
I would like the error bars to be behind the points otherwise they tend to
obscure the points (especially when I have a lot of points in the actual
data set).
2010 Nov 16
1
Batch Processing Files
Hi All!
I have some experience with R, but less experience writing scripts using
R and have run into a challenge that I hope someone can help me with.
I have multiple .csv files of data each with the same 3 columns of
data, but potentially of varying lengths (some data files are from short
measurements, others from longer ones). One file for example might look
like this...
Time, O2_conc,
2006 Feb 02
3
readline detection problems
Dear community,
I'm trying to install R-2.2.1 on an IRIX 6.2 (Unix System V Release 4)
system without root access. Unfortunately readline is not installed in
default, so I installed it locally in my home directory, more precisely in:
$HOME/vol/readline-5.1, where $HOME is "/home3/fa/faga001". Afterwards I
appended the path to the library with several $PATH variable, which now
looks
2006 Feb 02
3
readline detection problems
Dear community,
I'm trying to install R-2.2.1 on an IRIX 6.2 (Unix System V Release 4)
system without root access. Unfortunately readline is not installed in
default, so I installed it locally in my home directory, more precisely in:
$HOME/vol/readline-5.1, where $HOME is "/home3/fa/faga001". Afterwards I
appended the path to the library with several $PATH variable, which now
looks