-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathask.user.yn.question.Rd
More file actions
53 lines (47 loc) · 1.66 KB
/
Copy pathask.user.yn.question.Rd
File metadata and controls
53 lines (47 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% Generated by roxygen2 (4.0.2): do not edit by hand
\name{ask.user.yn.question}
\alias{ask.user.yn.question}
\title{Asks the user for one yes/no question.}
\usage{
ask.user.yn.question(question, use_GUI = TRUE, add_lines_before = TRUE)
}
\arguments{
\item{question}{a character string with a question to the
user.}
\item{use_GUI}{a logical indicating whether a graphics
menu should be used if available. If TRUE, and on
Windows, it will use \link{winDialog}, otherwise it will
use \link[utils]{menu}.}
\item{add_lines_before}{if to add a line before asking
the question. Default is TRUE.}
}
\value{
TRUE/FALSE - if the user answeres yes or no.
}
\description{
Asks the user for one yes/no question. If the users
replies with a "yes" (or Y, or y) the function returns
TRUE. Otherwise, FALSE. (also exists as the function
devtools::yesno)
}
\examples{
\dontrun{
ask.user.yn.question("Do you love R?")
ask.user.yn.question(question = "Do you love R?", use_GUI = TRUE) # the same one as before
ask.user.yn.question(question = "Do you love R?", use_GUI = FALSE)
# reverts to command line questions
ask.user.yn.question("Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip
ex ea commodo consequat. Do \\n you \\n love R?")
# checking how it deals with multi lines, and a lot of text (very good actually)
}
}
\references{
\url{http://stackoverflow.com/questions/15250487/how-to-add-a-menu-item-to-rgui}
(my thanks goes to Dason for his answer and help)
}
\seealso{
\link[utils]{menu}, (yesno in the package {devtools})
}