gsub is looking for a file?

17 views
Skip to first unread message

Gunther Fleerackers

unread,
Jun 18, 2014, 5:55:49 PM6/18/14
to shinyap...@googlegroups.com
Hi all,

I'm writing my first shiny app. The purpose is very simple : The user gets 6 numbers and he has to fill in the average. Cause I'm working in Belgium we use comma as decimal. So I wanted to have the user to fill in a number like "27,14" which I want to convert into a numeric 27.14. In R it works fine with the line:
as.numeric(gsub(",",".",answer, fixed=TRUE) 

but when doing this in a shiny app I get a an error :
  cannot open file '12': No such file or directory
Error in file(file, "r") : cannot open the connection

It seems gsub is looking for a file????

How can i get this to work properly?

best regards,
Gunther

Joe Cheng

unread,
Jun 18, 2014, 6:13:21 PM6/18/14
to Gunther Fleerackers, shinyap...@googlegroups.com
You're sure it's precisely that line that's causing that error?


--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/894b83fb-915a-4f9d-8012-b69fab4881c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gunther Fleerackers

unread,
Jun 19, 2014, 2:48:11 AM6/19/14
to shinyap...@googlegroups.com, gunther.f...@gmail.com
Hi Joe,

You are  right. I rewrote the pice of code and now it seems to work. It's a pity I lost the code of yesterday so i could reproduce the error.

thanks
Gunther

Op donderdag 19 juni 2014 00:13:21 UTC+2 schreef Joe Cheng:
Reply all
Reply to author
Forward
0 new messages