Shiny

Google Analytics for Shiny Dashboard App

这一生的挚爱 提交于 2019-12-31 03:05:14
问题 I have a well sorted out R shiny (shinydashboard) app that runs on a server. I want to be able to track its usage and know that google analytics is a good solution for this. But I have run into an issue setting it up. I have tried following the directions described here https://shiny.rstudio.com/articles/google-analytics.html They suggest the creation of a google-analytics.js script containing the global site tag from google: <!-- Global Site Tag (gtag.js) - Google Analytics --> <script async

r shiny - uiOutput not rendering inside menuItem

北城以北 提交于 2019-12-31 02:55:26
问题 Question Why does a sliderInput() that's generated on the server , and rendered on the ui with uiOutput() not get displayed in a menuItem() ? Example In this simple app I'm generating a sliderInput on the server (note the menuItem is deliberately commented out), and it works as expected library(shiny) library(shinydashboard) rm(ui, server) ui <- dashboardPage( dashboardHeader(), dashboardSidebar( sidebarMenu( #menuItem(text = "data options", checkboxGroupInput(inputId = "cbg_group1", label =

Place tab in Shiny tabsetPanel on the right

孤街浪徒 提交于 2019-12-31 02:31:12
问题 By default tabs in a tabsetPanel are put on the left. Is it possible to place a tab on the right side, while still having other tabs on the left? So that it looks like this? library(shiny) ui <- fluidPage( tabsetPanel( tabPanel("tab_left1"), tabPanel("tab_left2"), tabPanel("tab_right") ) ) server <- function(input, output, session) {} shinyApp(ui, server) 回答1: Using float-right should indeed work. The problem with using 2 tabsetPanel is that there are 2 active tabs at the same time. library

gvisTables not rendering in Shiny apps

旧巷老猫 提交于 2019-12-31 00:43:20
问题 The actual issue I'm trying to solve: I'm creating a dashboard which will include data tables. I would like for numbers to be formatted with commas as thousands separators, but there is (apparently) an issue with the DT package when it's used with Shiny, in that the comma-separated formatting causes DT::renderDataTable to read in numbers as character, which affects how the numbers are sorted. (DT's number formatting functionality does not work with Shiny, it appears.) Where I'm at so far: The

In Latest shiny, html rendering code breaks in renderDataTable

末鹿安然 提交于 2019-12-30 23:50:31
问题 Below code used to work well till I upgraded my shiny. Now it just prints out the html text. Does not render it as html ui.R dataTableOutput("grid") server.R testLinks<-function(){ serial<-(1:2) websites<-c("www.google.com","www.yahoo.com") Link<-paste0("<a href=\"",websites,"\" target=\"_blank\">", websites,"</a>") df<-data.frame(serial, websites,Link) df } output$grid<-renderDataTable(testLinks()) Now it just renders the links as html text Before the upgrade, it uses to render them as html

R shiny: update select input values in data.table

徘徊边缘 提交于 2019-12-30 14:48:07
问题 I have renderDataTable with select Inputs and buttons inside. I want to update selectInput inside datatable after click on 'Save' button in appropriate row. How can I do that? During searching for a solution I found that "if you rerender the table, the inputs won't work unless you add some extra code to unbind". However I am new in shiny and using js options, so I would be grateful for any hints/solutions. library(shiny) library(DT) runApp(list( ui = basicPage( h2('The mtcars data'), DT:

Receiving data from .js in server.R shiny

我们两清 提交于 2019-12-30 13:34:13
问题 How would I receive data, created in a .js file in the server.R in shiny? I am using the leaflat library and I need the extend the LatLngBounds of the current map view has. I need this variable in the server.R for furhter processing. So i have mycode.js //get bounds of extend of view $(document).ready(function() { var myBounds = map.getBounds(); Shiny.onInputChange("bounds", myBounds); }); which I include in the ui.R like tags$body(tags$script(src="mycode.js")) Thats how my Server.R looks

Can R Shiny display different views for two simultaneous users, interacting with one another?

假装没事ソ 提交于 2019-12-30 13:12:22
问题 Typically a Shiny server would spawn separate instances for individual users, so that multiple people can individually use the same app at the same time. This answer shows how to make a simple multi-user chat room using Shiny, and this answer explains how multiple users can connect to the same session via direct IP. I got the chat example to work, two users both see the messages immediately as they're being sent, and as such can chat to one another. I'm wondering if it is at all possible to

Access a dynamically generated input in r shiny

醉酒当歌 提交于 2019-12-30 11:29:28
问题 I have an app where the user needs to assign randomly generated elements (in this case, letters) to groups, but gets to decide how many groups to use. Because the selectInput where memberships are defined is generated dynamically in response to a number specified by the user, naming the menu is done automatically (e.g., usergroup1 , usergroup2 , etc.). I am having trouble accessing the input values and returning them from the module to use later because I won't know in advance how many inputs

How to populate csv files of a subdirectory inside shiny app in drop-down menu.?

混江龙づ霸主 提交于 2019-12-30 11:29:08
问题 Possible duplicate Cannot populate drop down menu dynamically in R shiny I have a small shiny app with some drop-down option for user. I created a subdirectory say data inside shiny app containing csv files to appear in the drop-down menu. I used the below code, but i am not able to access the files in the data subdirectory. On ui.r: filenames <- list.files(pattern="\\.csv") selectInput(inputId="dataset",label= "Choose platform annotation file",filenames) server.r: dataInput <- reactive({ if