Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

taking inputs through pop up window in R

Tags:

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..!

like image 253
avinash talari Avatar asked Sep 08 '17 12:09

avinash talari


1 Answers

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"
like image 52
parth Avatar answered Sep 20 '22 12:09

parth