shiny-server

How to display data in MainPanel based on user selection in Shiny R?

北慕城南 提交于 2019-12-02 08:34:51
My dataframe looks like below, and I would like to build ShinyApp such that when user selects System from SidebarPanel only info. related to selected system gets displayed in mainpanel . Currently, below app displays entire datatable in mainpanel. I am new to shiny and I not sure how to hide datatable in mainpanel . Is there any functionality available in Shiny ? Provide explanation with code DataFrame > df <- data.frame("Users" =c('A',"B","A",'C','B'), "Date" = c('17 Mar 2019','15 Mar 2019','11 Mar 2019','20 Apr 2019',"21 Apr 2019"), "Systems" = c("Sys1", "Sys1","Sys2","Sys3","Sys4"),

pass the read data in server.R into ui.R using shiny

蹲街弑〆低调 提交于 2019-12-02 04:45:54
In ui.R , I read at first a fixed sample data datT2<-fread(paste0('./data/','30062019KRB.csv'),header=TRUE, sep=";",stringsAsFactors = FALSE , encoding="UTF-8") to extract the data structure. however there are many data like 30062019KRB.csv whose structure varies a little bit from each other. In the next step in ui , I choose one name or one file and pass it to server.R ui.R : selectInput(inputId = 'date', label = 'Stichtag:', choices = list.files('./data', full.names = FALSE, recursive = FALSE)), and in server.R : I load the data based on the file name (for instance: 30062018KRB.csv) data <-

Capture the label of an actionButton once it is clicked

会有一股神秘感。 提交于 2019-12-02 04:31:24
Is it possible to capture the label of an actionButton once it is clicked? Imagine I have 3 buttons on my ui.R and depending on which one I click I want to perform a different action on the server.R. One caveat is that the buttons are created dynamically on the server.R with dynamic labels (thus the necessity of capturing the label on click) Thanks Pork Chop 1) What button was clicked last by the user? To answer this you can user observeEvent function and by setting up a a variable using reactiveValues function. Make sure you update your libraries and work in the latest version of R (version 3

Google Analytics for Shiny Dashboard App

时光总嘲笑我的痴心妄想 提交于 2019-12-02 00:49:47
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 src="https://www.googletagmanager.com/gtag/js?id=UA-4XXXXX5-2"> </script> <script> window.dataLayer =

Deploy an app on my own server without the port number in the address

落爺英雄遲暮 提交于 2019-12-01 21:17:07
问题 I have set up my own server with R and shiny-server, and had already put some apps on that. However, all apps have a port number like the :3838 in blahblah.com:3838/app_name , which doesn't look very nice, if my future plan is to build an entire site using shiny. So if that is possible to change some configuration that I can remove the :3838 from the address? 回答1: You need to change a setting in the Shiny Server config file (change the port it listens on). See below (assuming you are running

multiple drop-down bottoms in Shiny as filters for the data

时光怂恿深爱的人放手 提交于 2019-12-01 12:49:43
I want to apply multiple drop-down bottoms in Shiny as filters for the data. I found the following example . In this example one load a fixed data, namely mpg from ggplot2 . But I want to read the input file dynamically at first and then apply the drop-down choices as filters. Therefore I changed the code: GUI : fluidPage( titlePanel("Ausfallsbericht"), # Sidebar layout with input and output definitions ---- sidebarLayout( # Sidebar panel for inputs ---- sidebarPanel( fluidRow( #find all the files in ths path column(12, selectInput(inputId = 'date', label = 'Choose a date:', choices = list

Hosting LAN Shiny apps run from command line

与世无争的帅哥 提交于 2019-12-01 12:13:18
I am trying to host a Shiny app on a machine hooked up to a LAN. In the directory housing my app, I have the server.R, ui.R, and launcher.R scripts. The launcher.R file looks like: #!/usr/bin/Rscript library(shiny) setwd("~/path/to/shinyApp/") shiny::runApp(host="0.0.0.0",port=4414) When I run this via RStudio, the app launches, behaves normally, and can be accessed by other machines through the LAN by going to 987.65.43.21:4414 in a browser. When I run the app with launch.browser=T , the address reads 127.0.0.1:4414. I want to be able to run the launcher and host the app without RStudio

Add/remove input fields dynamically by a button in shiny AND keep values

淺唱寂寞╮ 提交于 2019-12-01 11:38:41
my question is a followup question on the following discussion: How to add/remove input fields dynamically by a button in shiny I want a be able to add/remove dynamically input with action button on shiny app, but also when I add a new input I want the values of the input fields to remain instead of change as it is now. Can you help me with this? For example if I change the first box and add another text input via the button, the value of the first box has been reset with the default one. library(shiny) ui <- shinyUI(fluidPage( sidebarPanel( actionButton("add_btn", "Add Textbox"), actionButton

multiple drop-down bottoms in Shiny as filters for the data

╄→尐↘猪︶ㄣ 提交于 2019-12-01 10:47:28
问题 I want to apply multiple drop-down bottoms in Shiny as filters for the data. I found the following example. In this example one load a fixed data, namely mpg from ggplot2 . But I want to read the input file dynamically at first and then apply the drop-down choices as filters. Therefore I changed the code: GUI : fluidPage( titlePanel("Ausfallsbericht"), # Sidebar layout with input and output definitions ---- sidebarLayout( # Sidebar panel for inputs ---- sidebarPanel( fluidRow( #find all the

ShinyApp Google Login

删除回忆录丶 提交于 2019-12-01 06:30:27
I have a shinyapp and I want to enable certain features to the members who login to the app using google login. I am not able to implement the Google login and authentication process within my app using the GoogleAuthR package. Does anyone has an example of a sample ShinyApp which allows the audience to login through either google or any other social forum authorizations Appreciate a demo with code. PS: I have no intention of running statistics on Google data but I only want to do away with the hassle of creating a login module for my app and let Google login take care of the hassles Thank you