Thanks for the reply! Most of my students are learning R for the very first time (along with online learning for the first time), so I've been trying to extent possible to keep all components of their work in a single R Notebook. Is it possible to change the location of where an app deploys when called from an R Notebook? If I have to, I'll make the Shiny components of the assignment extra credit, involving moving relevant code to an app.R file.
Hello,
I would struggle to tell you explicitly how to integrate this into your particular assignments. An R Markdown document can include shiny components. These should render properly in either the viewer pane or when the R markdown document is run in a window. An example of this is here,
https://rmarkdown.rstudio.com/lesson-14.html
A more general description of how to use shiny within an R markdown is here,
https://shiny.rstudio.com/articles/interactive-docs.html
Hopefully this is helpful,
Sean
Hi Sean,
The app deployment is already a component of the assignment, works offline, and worked when the quarter-long project was created in RStudio Cloud a few months ago. Here is a recap of what happens:
A student opens the "Assignment," which is one project pulled from GitHub, including the 9 notebooks for the quarter and completes the labx.Rmd for that week. They get to the section with the following code (considerably stripped here):
ui <- dashboardPage(
dashboardHeader(title = "TITLE HERE"),
dashboardSidebar(),
dashboardBody()
)
server <- function(input, output, session) { }
shinyApp(ui, server)
When they run the code chunk, they then get the error message reported in the thread:
Error in .Call("rs_shinyviewer", url, getwd(), "window", NULL, PACKAGE = "(embedding)") : Incorrect number of arguments (4), expecting 3 for 'rs_shinyviewer'
The proposed solution won't work for this use case because I can't toggle where this app deploys from an R Notebook. I've noticed that this is not happening for new projects. When I run the same code in a new project, everything works fine. So if I need to I'll recreate the project and have them switch assignments. I'm trying to avoid this as they need to reference work they've completed in previous labs/notebooks for future labs/notebooks, which is much more straightforward if they can just open their past notebooks from the same project. Just wondering if there's some way of getting around this error before I make that switch.
Lindsay
This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.