Code Monkey home page Code Monkey logo

shiny-examples's Introduction

shiny-examples

This is a collection of Shiny examples. You can see them in action on http://gallery.shinyapps.io/example-name where example-name is the directory name of an example here, e.g. http://gallery.shinyapps.io/001-hello

To run the examples locally, you can install the shiny package in R, and use the function runGitHub(). For example, to run the example 001-hello:

if (!require('shiny')) install.packages("shiny")
shiny::runGitHub("shiny-examples", "rstudio", subdir = "001-hello")

Or you can clone or download this repository, and use run shiny::runApp("001-hello").

Note the examples listed below depend on the development version of shiny to show some new features under development. Please be cautious that such features may or may not end up in the final release, or they may also change according to the feedback.

  • [None]

shiny-examples's People

Contributors

alandipert avatar aronatkins avatar bborgesr avatar bradleeedmondson avatar chjackson avatar cpsievert avatar daattali avatar gaborcsardi avatar gadenbuie avatar garrettgman avatar jcheng5 avatar jjallaire avatar karangattu avatar madhulikatanuboddi avatar micstr avatar mine-cetinkaya-rundel avatar randyzwitch avatar rich-iannone avatar schloerke avatar tmastny avatar trestletech avatar wch avatar webbp avatar yihui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shiny-examples's Issues

concatenated bidi strings do not appear in correct order using renderUI and htmlOutput

I have also posted this problem on stackoverflow. I am also appending another reproducible example here.
Notice the difference in order of the strings.

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(
   # Application title
   titlePanel("problem with bidi strings"),
      # Show a plot of the generated distribution
      mainPanel(
           fluidRow(
             column(width = 12, textOutput("txt"))
           ),
           fluidRow(
             column(width = 12, htmlOutput("example"))
           )        
      )
   )


# Define server logic required to draw a histogram
server <- function(input, output) {
    text <- "یہ جملہ ایک مثال کے لیے استعمال کیا جا رہا ہے"
    pattern <- "کیا جا"
    replaceWith <- paste0("<mark>", pattern, "</mark>")
    mysub <- function(text, pattern){
      beforePattern <- substr(text, 1, regexpr(pattern, text)[1]-1)
      afterPattern <- substr(text, regexpr(pattern,text)[1] + nchar(pattern), nchar(text))
      result <- paste(afterPattern, replaceWith, beforePattern)
      result
    }
  
  output$txt <- renderText({
    mysub(text, pattern)
  })
  output$example <- renderUI({
   temp <- mysub(text, pattern)  
   HTML(as.character(temp)) 
  }) 
}

# Run the application 
shinyApp(ui = ui, server = server)

Browser support

I am trying to work out what browser versions my shiny app works on.
Some of the apps in this repo have supported browser tables but 063-superzip-example does not.
I've just tried with IE8 on Win7 https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/ (in Vagrant as I'm on Linux so IE version 8.0.7601.17514) and it fails:

  'undefined' is null or not an object  pinit_main.js?0.22231112147439086, line 1 character 24032
  Expected identifier  datatables.js, line 76 character 14
LOG: Fri Jul 29 05:16:07 PDT 2016: Connection opened. https://gallery.shinyapps.io/063-superzip-example/
  Invalid argument.  leaflet.js, line 7 character 2344
LOG: Fri Jul 29 05:19:01 PDT 2016: Connection closed. Info: {"type":"close","code":1006,"reason":"Server lost session","wasClean":false}

Similar with 086-bus-dashboard

LOG: Fri Jul 29 05:30:10 PDT 2016: Connection opened. https://gallery.shinyapps.io/086-bus-dashboard/
  Invalid argument.  leaflet.js, line 7 character 2344

Is this a know issue? Is there some compatibility information I can find about? Leaflet itself works fine (as in the maps on http://leafletjs.com/ load) and supports IE 7-11.

Sorry if this is the wrong place to report this.

metaHandler Error and issue with sharing Shiny Dashboard

Hello.

I'm trying to share a shinyApp using shiny Dashboard. The web link that was provided to my by systems administrator at my university seems to only work when the shiny App I'm trying to share isn't using shinyDashboard ui.

The example I'm using in this post is a very abridged version because I simply wanted to see why the ui wasn't showing.

Whenever I click on the link, which I believe was created using the Shiny Server method for Linux servers, I receive this error:

ERROR: argument "metaHandler" is missing, with no default

Here is my example of the dashboard page that returns the error:
`

library(shiny)
library(shinydashboard)
dashboardPage(
dashboardHeader(
title = "CST"
),

                    dashboardSidebar(
                      sidebarMenu(
                        menuItem
                        ("Home", tabName = "Home"))
                    ),

            dashboardBody(
              fluidPage(
                mainPanel(
                p("It can be difficult to find population information from before 1990. Due to many requests from small communities, the Center for Small Towns is providing all population information for every county, town, and township in Minnesota dating back 1900."),                                
                p(br("This information was compiled from the U.S. Census and the American Community Survey. The following people played an enormous role in gathering this information and developing this website."))
                )
            )        
    )

`

Here is my Server code (I don't have any functions because I'm trying to see why the UI won't show):

`
library(shiny)
library(shinydashboard)

        shinyServer(function(input, output) { 
        })

`
I was told that if I use improper link breaking, that it could generate the error.

However, when I use shinyUI instead of a shinyDashboard page, I'm able to click on the link and I used practically the same line breaking as I did in the shinyDashboard example.

Here is the UI example that works (Server is the same in the above example):

`
library(shiny)
library(shinydashboard)

            shinyUI(
              fluidPage(
                mainPanel(
                p("It can be difficult to find population information from before 1990. Due to many requests from small communities, the Center for Small Towns is providing all population information for every county, town, and township in Minnesota dating back 1900."),                                
                p(br("This information was compiled from the U.S. Census and the American Community Survey. The following people played an enourmous role in gathering this information and developing this website."))
                )
              )
            )

    `

ONLY the shinyUI version seems to not generate that error when I attempt to use the link provided by the systems administrator.

I currently use my university's rstudio server at rstudio.morris.umn.edu. The shiny sever that we use is, I believe, CentOS/RHEL 5 (64 bit), so I don't believe he built the server from source.

Is it possible the shinyDashboard can't be shared via the method Linux Servers use?

Thanks,

Ricky.

Example 107-events: "Shiny is busy" when it is idle

Hi,

I have some heavy plots that takes more than 1 minute to be rendered.
I was trying to use a busy state to show a message like "working in progress".
However, I have the same problem that happens in the
example 107-events, the box "Shiny is busy" suddenly shows and hides when it was supposed to be idle.

Is there a solution ?

Thanks.

Error running the code!

Hello, I add this app to my existing app and when I want to show it to user, it produces the following error:

Listening on http://127.0.0.1:3295
Warning: Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
Stack trace (innermost first):
    75: .getReactiveEnvironment()$currentContext
    74: .dependents$register
    73: pkgData
    72: nrow
    71: vbox_fun [C:\...\v3\/server.R#320]
    70: shiny::renderUI
    69: func
    68: output$rate
     1: runApp
Warning: Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
Stack trace (innermost first):
    84: .getReactiveEnvironment()$currentContext
    83: .dependents$register
    82: dlCount
    81: tag
    80: tags$h3
    79: h3
    78: tag
    77: tags$div
    76: div
    75: tag
    74: tags$div
    73: div
    72: valueBox
    71: vbox_fun [C:\...\v3\/server.R#331]
    70: shiny::renderUI
    69: func
    68: output$count
     1: runApp
Warning: Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
Stack trace (innermost first):
    72: .getReactiveEnvironment()$currentContext
    71: .dependents$register
    70: pkgData
    69: nrow
    68: func [C:\...\v3\/server.R#347]
    67: output$packagePlot
     1: runApp
Warning: Error in .getReactiveEnvironment()$currentContext: Operation not allowed without an active reactive context. (You tried to do something that can only be done from inside a reactive expression or observer.)
Stack trace (innermost first):
    75: .getReactiveEnvironment()$currentContext
    74: .dependents$register
    73: pkgData
    72: eval
    71: eval
    70: %>%
    69: renderTable [C:\...\v3\/server.R#362]
    68: func
    67: output$packageTable
     1: runApp

Can you help me to solve this problem?
Thanks

License

I can't find a license for the content in this repo. Should I assume a AGPLv3 ?

does not load new report.rmd files

hi,
When I change the report.rmd file, it does not affect the output. Apparently, because of the copying the report.rmd file in the temp folder, it does not load the new file...

Files not be found

I am unable to run the shiny app using the code as i am unable access the web links which are in the code for transit. Can you please help me on this? I have project for i will need this as reference.

This is just amazing to use for my project.

Thanks

mathjax not rendering

I posted on SO as well here. Here's the question:


I'm having odd behavior with MathJax and shiny. I've modified the 01_hello example from the shiny package to include a .Rmd file via includeMarkdown(). All I modified was ui.R to be as follows:

# Show a plot of the generated distribution
mainPanel(
  plotOutput("distPlot"),
  includeMarkdown("mathjax-test.Rmd")
)

The contents of my test file (mathjax-test.Rmd) are like so:

## mathjax test

Document used as is in .Rmd format.

Here's an inline equation with dollar signs: $a + b = c$

Here's an inline equation with slashes/parentheses: \(a + b = c\)

Display format wth double dollar signs:

$$a + b = c$$

Display format with slashes/square brackets:

\[
a + b = c
\]

When I knit the .Rmd file, I get the expected results:

knit-rmd

When I use runApp() I get this:

shiny-rmd


Things I've tried:

  • adding withMathJax() after titlePanel in ui.R per this RStudio page
  • wrapping includeMarkdown() inside of withMathJax()
  • putting library(shiny) and withMathJax() in a code block at the top of the .Rmd file
  • adding the following first, right before, and right after includeMarkdown() in the mainPanel section of ui.R:

tags$script(src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML")

I have no idea what's going on! I get this in the <head> of the shiny app page when I view the source:

  <script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>

What am I doing wrong?

Few more examples to renderDataTable

Hi,
I found those examples very useful, there quite a few shiny+dataTables options tutorials over the web.
If possible I would propose to include some more examples:

  • Numeric formatting like: thousands separators, decimal separators, decimal precision.
  • Date formatting
  • Text encoding - I still cannot render polish country specific characters, I've check shiny::renderTable return value, it shows them well, but on the webpage it is not. I believe it is dataTables js side encoding issue. Setting options(encoding = "UTF-8") doesn't help.
    Regards,
    Jan

Super Zip - dateInput on Safari and Chrome

In the Super Zip example, if I add a dateInput in the absolutePanel, at least in Safari and Chrome the popup window opens at the right of the input instead of below and it is impossible to choose a date without moving to the left the entire absolutePanel.
screen

059-reactive-poll-and-file-reader has a typo

This side uses a reactiveFileReader, which is monitoring the log file for changes every 0.5 seconds.

Should be:

This side uses a reactiveFileReader, which is monitoring the log file for changes every 1 second.

063-superzip-example: superzip.rds creation code would be helpful

Question/Request:

In 063-superzip-example/data/deps.sh you provide code to download the data sets used in the example. In 063-superzip-example/global.R you read in the 063-superzip-example/data/superzip.rds serialized object that is the generated (I assume) from those input datasets.

Would you be willing to include the R code (or shell script) used to convert between the input data files and the 063-superzip-example/data/superzip.rds serialized object?

The examples have been super helpful. Thanks.

Super Zip Leaflet Rendering (ui.R) - Clarification

Hi,

(Note this may be a non-issue but at least wanted to point it out to possibly save some people future time.)

I wanted to give a heads up on the super zip code and map rendering. I was trying to replicate the SuperZip Shiny application by taking specific portions of the code. When users fully use the ui.R and server.R scripts (and dependency files, like css), everything works fine.

However, since people tend to copy/paste specific segments of code (like I did), I just wanted to point out that this code (which is currently line 24 in the ui.R superzip repository):

  leafletOutput("map", width="100%", height="100%"),

will not render the map unless the CSS and div are included. However, if people simply change the code to:

  leafletOutput("map", width="100%", height="300"),

As in, changing the height to an actual number and not a percent, the map will render without issue or the need for divs.

credit: https://stackoverflow.com/questions/39085719/shiny-leaflet-map-not-rendering

Not saying that anyone needs to change the code (it works fine if you use the entire file), but a comment or two might save some people some time.

This may be a dumb comment where it's a "duh, the code will only work when you include all the code" but since many people try to reverse engineer code, might be helpful to include a small comment that the rendering won't work unless the CSS is included, but also that you don't need to include CSS if you just change the height parameter to a number and not a percent.

Thank you for all your work.

--Pete

Small Error in Movie Filter

In the movie selection filter if one narrows the data set using the filters you will often find that the app will activate the wrong tooltip and movie ID with the hover function.

You need to include a filter f'or 'ID' in the reactive part of the table code so that ID is redrawn with the changing table dimensions.

(What is happening is that the tooltip is providing data on movies that the user wants to remove the table via the filter.)

063-superzip-example: unused argument error on data explorer

using shiny 0.12.1, DT 0.1

If I visit the "Data explorer" tab, there is an error shown in the browser:

Error: unused argument (server = TRUE)

The console shows:

Error in DT::datatable(df, server = TRUE, options = list(ajax = list(url = action)),  : 
  unused argument (server = TRUE)

Cannot get includeMarkdown() to highlight R code

Hi,

I'm not getting https://github.com/rstudio/shiny-examples/tree/master/048-including-html-text-and-markdown-files to highlight the R code. This happens regardless of whether I use R 3.2.4 or 3.3.0.

screen shot 2016-04-27 at 1 46 50 pm

Am I missing some configuration change?

Thanks,
Leo

Session info

> options(width = 120)
> devtools::session_info()
Session info -----------------------------------------------------------------------------------------------------------
 setting  value                                    
 version  R version 3.3.0 alpha (2016-03-23 r70368)
 system   x86_64, darwin13.4.0                     
 ui       AQUA                                     
 language (EN)                                     
 collate  en_US.UTF-8                              
 tz       America/New_York                         
 date     2016-04-27                               

Packages ---------------------------------------------------------------------------------------------------------------
 package   * version  date       source        
 devtools    1.11.1   2016-04-21 CRAN (R 3.3.0)
 digest      0.6.9    2016-01-08 CRAN (R 3.3.0)
 htmltools   0.3.5    2016-03-21 CRAN (R 3.3.0)
 httpuv      1.3.3    2015-08-04 CRAN (R 3.3.0)
 jsonlite    0.9.19   2015-11-28 CRAN (R 3.3.0)
 markdown  * 0.7.7    2015-04-22 CRAN (R 3.3.0)
 memoise     1.0.0    2016-01-29 CRAN (R 3.3.0)
 mime        0.4      2015-09-03 CRAN (R 3.3.0)
 R6          2.1.2    2016-01-26 CRAN (R 3.3.0)
 Rcpp        0.12.4.5 2016-04-16 local         
 shiny     * 0.13.2   2016-03-28 CRAN (R 3.3.0)
 withr       1.0.1    2016-02-04 CRAN (R 3.3.0)
 xtable      1.8-2    2016-02-05 CRAN (R 3.3.0)

Please make an index web page for all examples

I would love to quickly look at your examples running but as far as I can tell, I must invoke each one individually.

Please consider making a page that links to all of the examples. You could even make it a Shiny app!

Deploy script enhancement tasks

  • Default behavior (no args) should be to print out help, not deploy all
  • Add options for account name and server when deploying
  • Screenshots should be done in container, or with url2png service

Links in Readme

In the first paragraph of README.md:

This is a collection of Shiny examples. You can see them in action on
https://demo.shinyapps.io/example-name where example-name is the directory
name of an example here, e.g. **https://**demo.shinyapps.io/001-hello

Absence of some index page for demo.shinyapps.io was a little bit misleading.

No progressInit()?

I get:
ERROR: could not find function "progressInit"
maybe this is version skew with current shinyIncubator?

Apps with authentication fail on Safari 6

There is a general issue with Safari 6 and iframe.

[Error] Blocked a frame with origin "https://gallery.shinyapps.io" from accessing a frame with origin "http://shiny.rstudio.com".  The frame requesting access has a protocol of "https", the frame being accessed has a protocol of "http". Protocols must match.

    onLoad (onloadwff.js, line 143)
    global code (onloadwff.js, line 359)

applications load despite the error.

But for a couple of applications that requires authentication:

http://shiny.rstudio.com/gallery/personalized-ui.html
http://shiny.rstudio.com/gallery/authentication-and-database.html

authentication fails, with this error:

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (zocial.css, line 0)

Shiny: leaflet map events

I'm attempting to use some code similar to the zipsinbounds() reactive function. When I pass my function as a data argument to addCircles in leaflet, I receive an error of "argument length is zero (0)."

The main difference is that I'm using input$MAPID_zoom as the conditional instead of bounds. I only want to plot lat & long if the user has zoomed into a certain level on the map. My leaflet map is set to open at a zoom level of 4. Any help to get this working would be much appreciated. My code is below:

InBounds <- reactive({
if (input$OrgMap_zoom < 7) {
return(testdata[1:2,])
} else {
bounds <- input$OrgMap_bounds
latRng <- range(bounds$north, bounds$south)
lngRng <- range(bounds$east, bounds$west)

subset(testdata,
  latitude >= latRng[1] & latitude <= latRng[2] &
    longitude >= lngRng[1] & longitude <= lngRng[2])
 }

})

How to generate report

Hello Sir,

I tried to run the code given in app.R but I am not getting anything in the report. What to do with report.Rmd. Firstly I saved report.Rmd in same folder of app.R but it is not working then I saved it in tempdir then also the I am getting empty html report. Please help me. Thanks in advance.

Regards,
Pandurang

pandoc document conversion failed with error 41

If there is not a set of latex and pandoc software installed on the localhost then the pdf options will throw the error in the title. I haven't tried this on a shiny server but it is certainly the case with local host instances.

renderUI not working in absolutePanel of tabPanel

I have been referring 063-superzip-example to create something similar. I have been trying to use uiOutput and renderUI to create a dynamic selectInput box, whose values will be based on the unique values of a dataframe column. I have tried putting this selectInput inside the absolutePanel, but it won't generate any ui. The same piece of code works flawlessly with other layouts, such as tabsetPanel etc.

Is there any kind of limitation with absolutePanel or am I missing something ?

404 for message-handler.js

Hi. I've objectivised your functions as server and ui respectively and called them with shinyApp(ui, server, options = list(launch.browser=T)). But on client side the browser isn't picking up on message-handler.js (which yes is in subfolder www). Chrome console reports:

message-handler.js Failed to load resource: the server responded with a status of 404 (Not Found)

My app is served to http://127.0.0.1:6416/, and runs fine except for lack of the alert message. http://127.0.0.1:6416/www and http://127.0.0.1:6416/www/message-handler.js and http://127.0.0.1:6416/message-handler.js all return Not Found.

Am I missing something?

pandoc document conversion failed with error 47

successfully generated html But Not generated .pdf file gettiing below error

Changes in code:

In that same code i have just replaced report.html to report.pdf as per below.

"report.html" to change "report.pdf"

filename = "report.pdf",

Error:

pandoc: cannot produce pdf output with html writer
Warning: Error in : pandoc document conversion failed with error 47
Stack trace (innermost first):
53: pandoc_convert
52: convert
51: rmarkdown::render
50: download$func [/home/server.R#22]
1: runApp
Error : pandoc document conversion failed with error 47

"crandash" example application does not load properly

URL for the app:

https://gallery.shinyapps.io/087-crandash/

Error in the browser console:

Uncaught TypeError: Cannot read property 'render' of null
    at exports.OutputBinding.shinyBinding.renderValue (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/htmlwidgets-0.8/htmlwidgets.js:517:32)
    at exports.OutputBinding.onValueChange (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:4:450)
    at exports.OutputBinding.delegator.(anonymous function) [as onValueChange] (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/htmlwidgets-0.8/htmlwidgets.js:112:23)
    at OutputBindingAdapter.onValueChange (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:4:20029)
    at ShinyApp.receiveOutput (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:3:20097)
    at ShinyApp.<anonymous> (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:3:22029)
    at ShinyApp._sendMessagesToHandlers (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:3:21834)
    at ShinyApp.dispatchMessage (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:3:21624)
    at MultiplexClientChannel.c.onmessage (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/shared/shiny.min.js:3:17488)
    at MultiplexClient.onConnMessage (https://gallery.shinyapps.io/087-crandash/_w_25ddc61a/__assets__/rstudio-connect.js:564:15)

Customization with Datatables

I have been trying to play around with customizing datatables for a shiny app I am working on, and have run across several posts, but none really solve the problems that I am having.

See for example:
#9
http://stackoverflow.com/questions/29786286/how-to-use-row-grouping-for-datatables-in-shiny

I have a table of data on several different stock managers, which lists the stocks they hold, number of shares, and current market value (among other things). Ultimately, I want to transform that data into a table which will display the aggregate totals across these managers, but when clicked these rows will reveal x number of child rows showing which managers hold these stocks and the specific values.

Here is a snapshot of the data from Rstudio:

image

I have been playing around with the row.grouping feature, but can't seem to get this to work even at the most basic level. In part I think the problem is caused by the quotation marks. This code below being the first part of the example from the datatable.net site.

https://datatables.net/examples/advanced_init/row_grouping.html

datatable(combinedData, options = list(
  drawCallback = JS(
    "function(settings){",
    "var api = this.api();",
    "var rows = api.rows({page:'current'}).nodes();",
    "var last = null;",

    "api.column(2).data.each(function(group,i){",
    "if (last !== group){",
      "$(rows).eq(i).before(",
      '<tr class=\"group\"><td colspan=\"5\">'+group+'</td></tr>'"
          ");",
        "last = group;",
        "}",
      "});",
      "}", sep =""))))

Is what I am doing even possible with datatables through R and shiny. I have seen others posting their codes in jsfiddle, but even these other examples cannot be sorted by the group values, which is something I would like to ultimately do.

http://jsfiddle.net/X5LB9/1/
http://jsfiddle.net/968Pn/6/

Another thought would be to aggregate what I have and call on another table's data to populate child rows, but again, I do not see examples or documentation for this. Any assistance would be much appreciated.

Why no library(DT) in sample code?

Thanks for your wonderful examples.

I see you have DT:::datatable but I do not see any library(DT) in your example ui.R and server.R for the superzip example.

Based on https://rstudio.github.io/DT/shiny.html it seems it is needed, and I am getting namespace errors without it.

Sorry if this is not the right forum. The Shiny gallery Superzip does not show the code so I could not check it on the gallery, and hence I am in Github.

I am trying to get datatable working for my own app so I am just querying this as a learner.
Thanks
micstr

Get the number of times a word is written

Hi,
I created a wordcloud from a .txt file. It works well. What I want to do is to plot a table above with, for every words of my wordcloud, the number of times each word appears.

Any idea ?

Thanks

for 016-knitr-pdf, input$x in code chunks?

Great example for making pdf reports with knitr in a shiny app, but I was wondering if you could insert input$x into a code chunk instead of just inline code. I'd like to display the result of a user input as a parameter to a function call, and display this in a code chunk. I made a stackexchange issue about this here. Is there any way to do this? Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.