Upload Shiny App to shinyapps.io in Showcase Mode - r

I'm trying to upload a Shiny App to shinyapps.io in Showcase mode. According to those directions, one includes a text file named DESCRIPTION (no extension) with the following fields (this is from the example linked above:
Title: Hello Shiny!
Author: RStudio, Inc.
AuthorUrl: http://www.rstudio.com/
License: GPL-3
DisplayMode: Showcase
Tags: getting-started
Type: Shiny
This answer describes the same process - but, it seems like it doesn't work any longer.
When I try to publish a Shiny App with a DESCRIPTION file like the one int he example, the following error is returned:
Preparing to deploy application...DONE
Uploading bundle for application: 88219...Error in readDcf(file.path(project, "DESCRIPTION"))[, "Package"] :
subscript out of bounds
Calls: <Anonymous> ... suppressMessages -> withCallingHandlers -> <Anonymous> -> unname
Execution halted
For what it's worth, I tried excluding different fields from the DESCRIPTION file, even trying one with only DisplayMode: Showcase included. I also tried saving the file in different editors.
This Google Groups thread seems to suggest this is a bug, but since there doesn't seem to be a question posted about it other than when this worked, I hoped to see if anyone had found or could suggest a fix.
EDIT: I posted an Issue on the Shiny Apps GitHub page.

Installing the latest version of packrat from GitHub (i.e., devtools::install_github("rstudio/packrat") did the trick, thanks to this GitHub Issue suggestion. Installing the latest CRAN version (install.packages("packrat")) did not work.

I open my shinyapp on the shiny server in Showcase mode using DESCRIPTION file with additional fields that were not described in documentation and it works.
Package: MyShinyApp
Version: 1.0
Title: Hello Shiny!
Author: RStudio, Inc.
AuthorUrl: http://www.rstudio.com/
License: GPL-3
DisplayMode: Showcase
Tags: getting-started
Type: Shiny
Adding fields Package and Version will resolve this error ERROR system error 71 (Protocol error) [description=Version field not found in...]

Related

Can I use shinytest with a Shiny App that produces PDFs from an Rmd template?

I'm working on a relatively complex shiny app that allows for a wide variety of user inputs. These user inputs are then used for a series of calculations and they're presented in the form of several tables and graphs. The final results can then be downloaded in the form of a PDF that is generated from a custom .Rmd template and .tex files. This relies on tinytex.
Up to this point, I've been testing the app manually. However, I'm interested in using shinytest to create a more robust testing pipeline. I've followed the documentation and I've run into the following issue.
Running mytest.R Error in is_rmd(path) :
Unknown whether app is a regular Shiny app or .Rmd: C:/Users/maxwe/OneDrive/Documents/PATH_TO_TEST/tests/R
Calls: <Anonymous> ... <Anonymous> -> as.list -> as.list.environment -> is_rmd
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="C:/Users/maxwe/OneDrive/Documents/PATH_TO_TEST/R/tests/R": The system cannot find the file specified
Execution halted
Is shinytest getting confused when it detects the .Rmd file? My application is structured as a CRAN package (see below).
Package --- inst
man
packrat
R ---
reports --- *.Rmd, *.tex
rsconnect
test
Is it possible for me to use shinytest to test this app? Or would I need to use a different approach?

rmarkdown version 1.11 throws errors on existing prerendered files

I have several learnr tutorials running on a shiny server. After updating rmarkdown to version 1.11 I get the following error message whenever there exists a prerendered HTML file:
Error in file.exists(dep$src$file) : invalid 'file' argument
Calls: ... shiny_prerendered_html -> shiny_prerendered_prerender -> file.exists
Execution halted
Versions 1.9 and 1.10 work fine.
Any idea/help would be highly appreciated!
I did not manage to produce a short example - all partial files seem to work. A full file can be downloaded here
I also have the same problem, a very quick and dirty solution is to delete the index.html file before each new render, but hoping for a more structural solution.

Error when adding DESCRIPTION file to shinyapps.io

recently I wanted to enable the Showcase mode on my Shiny app, which I uploaded to shinyapps.io. I looked at some other questions in this forum and created a DESCRIPTION file (no file extension) that looks like this:
Title: XX
Author: YY
DisplayMode: Showcase
Type: Shiny
As soon as I want to upload my App together with the Description file (using either the "publish" button provided by RStuio or using the "shinyapps::deployApp("XX",account="yy")" command), I get the following error (99999 is an edited number):
Preparing to deploy application...DONE
Uploading bundle for application: 99999...Error in readDcf(file.path(project, > "DESCRIPTION"))[, "Package"] :
subscript out of bounds
Calls: ... suppressMessages -> withCallingHandlers -> -> unname
Execution halted
I also tried adding/removing lines from the DESCRIPTION file, including the DisplayMode line, but it didn't help. Uploading the App without the Description file still works fine. Furthermore I completely uninstalled R and RStudio and reinstalled the newest versions (3.2.3 and 0.99.879). I am using Windows 10.
Also the app works fine and is in Showcase mode if I run it locally.
Any ideas what this could be about?
Thank you so much in advance,
Laurin

Deploy R markdown document on shinyapps.io

I'm trying to deploy an R markdown document on the shinyapp.io server.
I have followed the steps as described here.
However, step 8 indicates the presence of a "deploy" button. This button is missing.
As an alternative I have tried :
to open a new R script
Navigate to the Working Directory for my .Rmd file
Ran the following command: deployApp( appName = "Titanic")
Logs indicated everything was being uploaded correctly. However my destination page indicated 'not found'.
My questions:
Why did the 'deploy' button not show?
Why does my page indicate 'not found'?
Below you can find the header I used in the markdown document.
title: "KAGGLE - TITANIC SURVIVAL ANALYSIS"
output:
html_document:
toc: true
theme: spacelab
number_sections: true
runtime: shiny
Thank you in advance
Issue solved with R Studio version
Version 0.99.451 – © 2009-2015 RStudio, Inc.
!Note: In the newest version the deploy button has been replaced with Publish
This has not been adapted in the official shiny documentation yet. The screenshot below is the view you get once a first publish (formerly called deploy) action has been taken.

Trouble with Pandoc installation on Ubuntu 14.04LTS for using with R Markdown

This question is a corollary of my attempts to get some experience with creating reproducible reports from R Markdown documents via knitr and rmarkdown R packages. While it seems that .Rmd => HTML conversion is automated from within RStudio (Knit HTML button), my attempt to do the same outside of RStudio (Rscript -e 'library(rmarkdown); render("knitr-example-slides-1.Rmd")') failed due to, according to the message, lack of pandoc on my system. This is most likely false, since RStudio somehow managed to perform the conversion. Therefore, it is most likely an access and/or path issue.
Without knowledge of where RStudio maintains pandoc and details about the access, I have decided to install pandoc myself. Unfortunately, sudo apt-get install pandoc has not been very helpful, due to the fact that current version of pandoc in Ubuntu's trusty repository (14.04LTS) is 1.12.2.1. According to rmarkdown's message, version 1.12.3 or higher is required. "Not a big deal", I have thought, and followed instructions on installing pandoc in case of too old version in repository (http://johnmacfarlane.net/pandoc/installing.html). That requires installing the Haskell platform, which is pretty big and which output is rather verbose. After some time, I finally has been greeted with the following failure message:
[ 6 of 57] Compiling Text.Pandoc.Readers.TeXMath ( src/Text/Pandoc/Readers/TeXMath.hs, dist/build/Text/Pandoc/Readers/TeXMath.o )
src/Text/Pandoc/Readers/TeXMath.hs:30:38:
Ambiguous occurrence `readTeXMath'
It could refer to either `Text.Pandoc.Readers.TeXMath.readTeXMath',
defined at src/Text/Pandoc/Readers/TeXMath.hs:56:1
or `Text.TeXMath.readTeXMath',
imported from `Text.TeXMath' at src/Text/Pandoc/Readers/TeXMath.hs:33:1-19
(and originally defined in `Text.TeXMath.Parser')
Failed to install pandoc-1.12.4.2
cabal: Error: some packages failed to install:
pandoc-1.12.4.2 failed during the building phase. The exception was:
ExitFailure 1
pandoc-citeproc-0.3.1 depends on pandoc-1.12.4.2 which failed to install.
Firstly, I'm not sure how to fix it. Secondly, I very much suspect that there should be an easier way to enjoy generating reproducible reports with rmarkdown and pandoc than this. Your advice will be appreciated!
UPDATE (see comments):
Rscript -e 'library(rmarkdown); render("knitr-example-slides-1.Rmd")'
processing file: knitr-example-slides-1.Rmd
|....... | 11%
ordinary text without R code
|.............. | 22%
label: setup (with options)
List of 1
$ include: logi FALSE
Quitting from lines 6-8 (knitr-example-slides-1.Rmd)
Error in eval(expr, envir, enclos) : object 'opts_chunk' not found
Calls: render ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted
Basically, #daroczig answered this question in his comment above, so I will repeat it here, plus will add an answer to the relevant minor question on the issue, appeared after the main question's issue fix.
1) "A binary compiled version of Pandoc is already shipped with RStudio, so you can simply create a symlink, so that you could easily use that outside of the RStudio eco-system: https://github.com/rstudio/rmarkdown/blob/master/PANDOC.md#newer-systems-debianubuntufedora";
2) I have fixed the error, experienced after applying the advice above (see my comment), by calling opts_chunk() using explicit package reference: knitr::opts_chunk(), following guidelines here: http://rmarkdown.rstudio.com/authoring_migrating_from_v1.html (thanks to #Yihui for pointing me to this document in a different question: Transitioning research project to knitr-based setup).

Resources