avinash talari
avinash talari

Reputation: 93

taking inputs through pop up window in R

I would like to read an input given by User in R programming through message window.

For example, It should give a message "enter the number" in a pop up box along with option of entering a number in the message box itself. Then I would like to store that number in a variable.

Thanks for your help in advance..!

Upvotes: 8

Views: 16444

Answers (1)

parth
parth

Reputation: 1631

The svDialogs provides such solution.

library(svDialogs)
user.input <- dlgInput("Enter a number", Sys.info()["user"])$res

which gives a pop-up as

snap1

Also, user input is stores

> user.input
[1] "68"

Upvotes: 27

Related Questions