[R-gregmisc-commits] r2159 - pkg/gtools/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jun 13 00:51:21 CEST 2017
Author: warnes
Date: 2017-06-13 00:51:21 +0200 (Tue, 13 Jun 2017)
New Revision: 2159
Modified:
pkg/gtools/man/ask.Rd
Log:
Add 'con' argument to ask() to allow specification of the connection to query for input.
Modified: pkg/gtools/man/ask.Rd
===================================================================
--- pkg/gtools/man/ask.Rd 2017-06-12 22:49:49 UTC (rev 2158)
+++ pkg/gtools/man/ask.Rd 2017-06-12 22:51:21 UTC (rev 2159)
@@ -5,15 +5,21 @@
Display a prompt and collect the user's response
}
\usage{
-ask(msg = "Press <RETURN> to continue: ")
+ask(msg = "Press <RETURN> to continue: ", con=stdin())
}
\arguments{
\item{msg}{Character vetor providing the message to be displayed}
+ \item{con}{Character connection to query, defaults to \code{stdin()}.}
}
\details{
The prompt message will be displayed, and then \code{readLines} is
used to collect a single input value (possibly empty), which is then
returned.
+
+ In most situations using the default \code{con=stdin()} should work
+ properly. Under RStudio, it is necessary to specify
+ \code{con=file("stdin")} for proper operaation.
+
}
\value{
A character scalar containing the input providede by the user.
@@ -31,6 +37,6 @@
age <- as.numeric(age)
cat("In 10 years you will be", age+10, "years old!\n")
}
-
+
}
\keyword{IO}
More information about the R-gregmisc-commits
mailing list