-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iframes only work when pressing knit html button in rstudio #12
Comments
Hm, I am not an expert in writing knit hooks, so do you have any ideas? In Another thing that would be nice but I don't have any idea how to do is to On Fri, Apr 18, 2014 at 2:13 AM, Scott Chamberlain <notifications@github.com
|
When knitting from the command line,
Not sure how to get around this. Interactivity seems to be a property of the session. Is it possible to create a new non-interactive session from within the console? |
I can not get the embedded iframes to work, tried both RStudio's 'knit html' button and knit(). Trying to replicate this: http://ropensci.org/blog/2014/04/17/plotly/. |
Hello @ouzor ! Follow the syntax below when writing your You want to set the Hope this helps! |
@ouzor Note that after clicking "Knit HTML" I also had to "Open in Browser" in order to see the embedded Plotly plot. The plot was generated (you can check online in your Plotly account), it's just a rendering thing. |
Thanks @mkcor, this works! I was not able to find much documentation for the ggplotly command, is that available somewhere? |
@ouzor We are indeed behind with respect to documentation. |
Thanks! |
Hi @ouzor We definitely understand that’s a concern. Thanks for asking. A couple thoughts. You control the privacy of your data, and can make your work public or keep it private (like Google Docs or GitHub). You own your data; we don’t make an IP claim to it. We also have an on-premise version of plotly you can run on your own servers. Would any of these options work? Let me know if we can help with anything. |
Thanks a lot @mkcor, I'll take a closer look at these options! |
why does this not work?? Rely on the 'WorldPhones' dataset in the datasetspackage (which generally comes preloaded).library(datasets) Define a server for the Shiny appshinyServer(function(input, output) { Fill in the spot we created for a plotoutput$phonePlot <- renderPlotly({
gg <- barplot(WorldPhones[,input$region]*1000, p <- ggplotly(gg,session="knitr") |
Despite following @mkcor's fix that seemed to work for @ouzor, I run into the listed error msg when running Knit HTML and when executing the code line-by-line from inside RStudio.
Quitting from lines 27-30 (testingplotly.Rmd)
Error in eval(expr, envir, enclos) : attempt to apply non-function
Calls: ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted
|
The interface has changed quite a bit since this thread first started. You should only need this: library(plotly)
gg <- ggplot(cars) + geom_point(aes(speed, dist))
ggplotly(gg) |
thanks Carson |
Or at least for some people the hook only works when pressing knit html button in rstudio.
Perhaps we need to edit the knit hook to make it work in any context.
The text was updated successfully, but these errors were encountered: