Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny app crashes on Mac in RStudio

When I run a Shiny App either an example or my own it starts a new window, freezes and then aborts. It tries to listening to a local port then starts a new session.

Details of my system:

My R version: 3.1.3 on MacOS Maverick

other attached packages: [1] shiny_0.12.0 Rcpp_0.11.6

loaded via a namespace (and not attached): [1] digest_0.6.8 htmltools_0.2.6 httpuv_1.3.2 mime_0.3 R6_2.0.1
[6] tools_3.1.3 xtable_1.7-4

What I tried so far:

From different internet forums I found a lot of suggestions:

  • I reinstalled Rstudio.

  • I updated all the packages

  • Tried this: install.packages(c("Rcpp", "httpuv", "shiny"))

  • Loaded Rcpp and httpuv separately

  • tried to run like this runApp('app1',host="127.0.0.1",port = 3894)

    // tried other ports as well.

But nothing works. (Please note that, I don't know whether it's relevant but GoogleVis Demo worked on my RStudio.)

like image 200
Shiv Avatar asked May 03 '16 08:05

Shiv


People also ask

How do you run a Shiny in RStudio?

Open the app. R script in your RStudio editor. RStudio will recognize the Shiny script and provide a Run App button (at the top of the editor). Either click this button to launch your app or use the keyboard shortcut: Command+Shift+Enter (Control+Shift+Enter on Windows).

Do you need R to run Shiny app?

You might be eager to deploy your Shiny app to a remote server. But the simplest way to run a Shiny app is to run it locally. You only need the shiny R package installed, and you can run the app in your browser. In this post you'll see a few ways of how to organize your files to be served locally.

What are the main 2 parts of an R Shiny app?

A Shiny app consists of two parts, a user interface ( ui ) and an R session that runs code and returns results ( server ). These two parts can be in their own files called ui. R and server. R, or they can be combined into a single file called app.


1 Answers

@roboticman

My recommendation is first to test and confirm R is correctly setup on your machine. We can then move to harness a Shiny demonstration application and confirm if that works.

https://technophobe01.shinyapps.io/WorldBank/

First step:

Can you please run the following command via R, this should download and install shiny and its dependencies...

> install.packages("shiny", dependencies = TRUE)

If things work after this, great. If not, well, then let's check your R configuration:

Validate R Install

To check your configuration, my recommendation is you launch R on your machine and run the following tests and post back the output.

> R
> sessionInfo()
Sys.setenv(LC_COLLATE = "C", LC_TIME = "C", LANGUAGE = "en")
library("tools")
testInstalledBasic("both")
testInstalledPackages(scope = "base")
testInstalledPackages(scope = "recommended")
testInstalledBasic("internet")

Once you post the output of the above command set, we can move to work through the example 'World Bank', and see if we can determine the problem.

Take care

like image 124
Technophobe01 Avatar answered Oct 21 '22 01:10

Technophobe01