1

I have installed shiny in RStudio running R 2.15.3. I load the package by library(shiny) But when I try to use shinyApp command I'll get the following

library(shiny)
ui <- fluidPage()
server <- function(input,output){}
shinyApp(ui=ui,server=server)

Error: could not find function "shinyApp"

And even when I'm trying to use R help by :

?shinyApp

the answer is :

No documentation for ‘shinyApp’ in specified packages and libraries:
you could try ‘??shinyApp’

And it is very disappointing because this command is one of the essential commands that you need all time !

I have to mention that the sample code I have tried to compile, is from official tutorial by shiny (shiny.rstudio.com/tutorial) ! So basically it should work.

Can somebody help me on this please !

5
  • 1
    Just a guess, but you might want to install the latest R version? See r-project.org
    – maller
    Commented Jun 21, 2017 at 12:44
  • 1
    According to the documentation, [cran.r-project.org/web/packages/shiny/shiny.pdf], These functions create Shiny app objects from either an explicit UI/server pair ( shinyApp ), or by passing the path of a directory that contains a Shiny app ( shinyAppDir ). You generally shouldn’t need to use these functions to create/run applications; they are intended for interoperability pur- poses, such as embedding Shiny apps inside a knitr document
    – akrun
    Commented Jun 21, 2017 at 12:45
  • 1
    You cannot see documentation because you write app with upper letter. Use ?shinyApp instead ?shinyAPP Commented Jun 21, 2017 at 12:52
  • What version of shiny are you using? Check with sessionInfo(). In older versions it used to be called runApp() I think. You are using a fairly old version of R so you might not be able to install the latest version of the package.
    – MrFlick
    Commented Jun 21, 2017 at 13:10
  • I have updated R to 3.4.0 , but still I have the same issue, and it is appearing on windows. when I'm using mac to compile it, It is working without a problem ! Commented Jun 21, 2017 at 13:26

2 Answers 2

4

Update R to the version required by Shiny (>=3.0.0) then run update.packages() in R.

The reason you're getting this error is probably because you installed Shiny under an old R version, and thus, you got an old version of Shiny. When you updated R on your Windows computer, it used the packages already there in your old R installation, i.e., the old version of Shiny.

0

As mentioned before, the issue comes from not having the proper configuration of R and shiny, however in RStudio (which I'd asume you are using since you are following the tutorial) a much easier solution is to click on the "Run App" button and it should give you the option to install shiny if it detects its missing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.