Error deploying shiny app: could not find function "rep_len"

90 views
Skip to first unread message

Nate Gilbraith

unread,
Jul 30, 2014, 4:24:44 PM7/30/14
to shinyap...@googlegroups.com
Hello, 

I have tried several times to upload an app but I getting an error during the deploy process:

Uploading application bundle...DONE
Deploying application: 16823...
Waiting for task: 747792
 building
: Processing Bundle Id: 35991
 error
: Parsing manifest
Error in paste(rep_len("#", r), collapse = "") :
 could
not find function "rep_len"

Thank you very much for the help.

Nate

Fereshteh Karimeddini

unread,
Jul 30, 2014, 5:10:45 PM7/30/14
to shinyap...@googlegroups.com
Nate,

Where is this line of code: paste(rep_len("#", r), collapse = "")

Is this in one of your R scripts? Can you share your code? Or directory structure?

Fereshteh

Nate Gilbraith

unread,
Jul 30, 2014, 5:41:49 PM7/30/14
to shinyap...@googlegroups.com
Fereshteh,

Thanks for helping out with this.

I will share my code when I get back to my computer, but in the meanwhile, I do not have that line of code in any of my scripts. Off the top of my head I believe the only packages I load are 'akima' and 'fields'.

Nate

Nate Gilbraith

unread,
Jul 30, 2014, 9:09:44 PM7/30/14
to shinyap...@googlegroups.com
Fereshteh, 

I have attached my server.R and ui.R files.  I also tried removing the two packages that I load (they are only used to create one figure) but this did not change the error message that occurred when I tried to re-deploy the app.  

Nate
server.R
ui.R

Fereshteh Karimeddini

unread,
Jul 31, 2014, 12:52:08 AM7/31/14
to shinyap...@googlegroups.com
Nate,

Thanks for sending these files. But your application depends on some other files that you did not send. I was able to deploy the app (without those files); app won't work properly, but deploy was successful. So the error must be caused by other files in your application folder. You can either send me all your files (if you don't mind sharing them), or you can try removing the other files from your application directory, one by one, and see at what point your deploy is successful. It is very possible that shinyapps is parsing something incorrectly, but we need to know what is it.

Fereshteh

Nate Gilbraith

unread,
Jul 31, 2014, 3:53:33 AM7/31/14
to shinyap...@googlegroups.com
Fereshteh,


This is all of the files, less 1 data file that is 5.8MB.  If you send me your email I can share it via dropbox or google drive. 

Nate

Nate
annualSaveDat.RData
capShortfallDat.RData
finalBasisDat.RData
normalize.R
bigorb.png

Nicholas Mader

unread,
Aug 3, 2014, 10:33:45 PM8/3/14
to shinyap...@googlegroups.com
I'm also having effectively the exact same problem. Relatively simple app (server.r, ui.r, and small data source attached), which I am trying to deploy to shinyapps.io, but receiving the message -- Error in paste(rep_len("#", r), collapse = "") : could not find function "rep_len".

My understanding is that the rstudio server is only running R version 2.15.3 (confirmed from sessionInfo()), and that rep_len() was introduced as of version 3. However, I can't figure out where in my code the rep_len() function is being introduced so that I can work around it.

Thanks for any thoughts!
Nick
elem_data.csv
server.r
ui.r

Fereshteh Karimeddini

unread,
Aug 3, 2014, 11:25:58 PM8/3/14
to shinyap...@googlegroups.com
Nick, (and Nate)

The error is coming from shinyapps package, not from your code. There are references to "rep_len" within shinyapps, and therefore (at the moment) it won't work with R versions of lower than 3.0.0. Would it be possible for you to upgrade your version of R? We are evaluating what the minimum supported version of R should be, and it is good to hear from you and others if there is any strong reason to stay with R 2.15.x.

Best,
Fereshteh

Nicholas Mader

unread,
Aug 4, 2014, 1:15:55 AM8/4/14
to shinyap...@googlegroups.com
Hi Fereshteh,

All of my local instances of R are upgraded to version 3+; where I'm stuck is developing my shiny app on RStudio's Spark server which seems still to be running R 2.15.3. Here is a related thread, where several other RStudio staff are responding to a user's question about server updates: https://groups.google.com/forum/#!topic/shiny-discuss/Ve9YBbl99iQ.

Any additional thoughts on how to work with the shinyapps package on that server, or suggestions on where else to try developing the code?

Nick

Nate Gilbraith

unread,
Aug 4, 2014, 10:24:30 AM8/4/14
to shinyap...@googlegroups.com
Fereshteh,

That fixed it.  I don't have any reason why you keep shinyapps functional with previous versions of R (unless you feel like catering to the oblivious R users like myself).  I would recommend including text in the documentation or error message that R 3.0.0 is the minimum version necessary to use shinyapps successfully.

Thanks again for the help!

Nate

Fereshteh Karimeddini

unread,
Aug 4, 2014, 11:02:06 PM8/4/14
to shinyap...@googlegroups.com
Hi Nicholas,

As it was mentioned in that thread, there is no plan to upgrade version of R on spark server. Since you are using shinyapps.io, isn't that a better platform for you and your applications? What are your reasons for still needing spark? This is just to understand your needs, and be able to better help you.

Best,
Fereshteh

Fereshteh Karimeddini

unread,
Aug 4, 2014, 11:05:13 PM8/4/14
to shinyap...@googlegroups.com
Nate,

Thanks for the update. Good to hear that your issue is resolved. If we decide to require minimum  3.0.0, we will add necessary code (and documentation) to prevent users from deploying with wrong versions of R. Thanks for the suggestion.

Best,
Fereshteh

Nicholas Mader

unread,
Aug 5, 2014, 12:40:43 PM8/5/14
to Fereshteh Karimeddini, shinyap...@googlegroups.com
Hi Fereshteh,

What I have learned in the last day or so is the fact that I really do have no need to develop apps on Spark. I simply had not realized that I could develop locally (where I have R version 3 installed) and deploy to shinyapps.io directly. Problem solved, and I'm the happy owner of a brand new app.

Thanks very much for helping provide guidance on this!

Nick


--
You received this message because you are subscribed to a topic in the Google Groups "ShinyApps Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shinyapps-users/Bcs2IWL0PqU/unsubscribe.
To unsubscribe from this group and all its topics, 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/4f9a6a35-ea6f-42a9-a89d-32a617608c6d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Nicholas Mader, PhD
Senior Researcher
Chapin Hall at the University of Chicago
1313 E 60th St., Chicago, IL  60637
W: 773-256-5195, C: 608-332-1029
http://www.chapinhall.org
Message has been deleted

Fereshteh Karimeddini

unread,
Aug 6, 2014, 12:05:32 AM8/6/14
to shinyap...@googlegroups.com, fere...@rstudio.com
Nicholas,

Good to hear that you have been successful deploying your app to shinyapps.io, and it is working for you. Let us know if any other issues come up.

Best,
Fereshteh
Reply all
Reply to author
Forward
0 new messages