shinydashboard not loading on the first call to it

785 views
Skip to first unread message

joeoli...@gmail.com

unread,
Feb 6, 2015, 2:38:36 PM2/6/15
to shiny-...@googlegroups.com


I am using the shinydashboard package and I have a app.r file that looks like:

library(shiny)
library(shinydashboard)

shinyApp(ui, server)

I press CTRL + SHIFT + ENTER to run it and I get an error:

Error in eval(expr, envir, enclos) : 
  could not find function "dashboardPage"

But then I highlight

library(shinydashboard)

and re-run that line by pressing CTRL + ENTER

and the output is:

Attaching package: ‘shinydashboard’

The following object is masked from ‘package:graphics’:

    box

THEN I press CTRL + SHIFT + ENTER again and the app works fine.

Any idea why "library(shinydashboard)" doesn't seem to register the first time or any way I can attach it like it seems to want?

Winston Chang

unread,
Feb 6, 2015, 3:03:51 PM2/6/15
to joeoli...@gmail.com, shiny-discuss
That's really weird. Maybe you have some strange non-visible characters on that line or the surrounding ones? I've seen that happen before when code is cut and pasted. I'd try deleting the first three lines, and then typing them in manually.

If that doesn't fix it, you can send me the code directly and I'll see if I can find the problem.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/a0304a1a-e2c6-4cea-b3a1-2f16a4ca7c20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Winston Chang

unread,
Feb 10, 2015, 12:08:43 PM2/10/15
to joe oliver, shiny-discuss
Hi Joe, I've taken a look at your app. The problem is that you have a app.r file, in addition to server.r and ui.r.

You can either use a single file called app.r, or you can use server.r + ui.r.

For examples of using app.r, see:

For examples of server.r + ui.r, see:

-Winston
Reply all
Reply to author
Forward
0 new messages