shinydashboard

How to display Year to Date data in ShinyDashboard R?

我是研究僧i 提交于 2019-12-11 16:23:06
问题 Below is the dataset. This dataset is about instrument usage at specific location in specific year. currently below code is displaying the results according to the selected option from SideBar Panel i.e when user selects "Loc1" and Year "2018", it will filter and display the data in the mainpanel in the form of Chart as well as table. Next, I would like to display YTD(Year-to-Date) results in the mainpanel when latest year is selected. In this case when user selects Loc1 and Year 2019, the

Implementing span to click on plot and move in R shiny

允我心安 提交于 2019-12-11 15:26:27
问题 The given code creates a simple scatterPlot. I wish to click on the plot and move it in any direction that I want to, basically the span functionality. Attached the snapshot for references.Please help and thanks. ## app.R ## library(shiny) library(shinydashboard) library(bupaR) library(edeaR) library(eventdataR) library(processmapR) library(processmonitR) library(xesreadR) library(lubridate) library(dplyr) library(knitr) library(XML) library(xml2) library(data.table) library(ggplot2) library

Reactive formattable in shiny?

好久不见. 提交于 2019-12-11 14:56:00
问题 How can I use formattable to color some values in reactive tables ? Here's a reproducible example : I would like to color p-values in red if they are inferior to 0.05 in the reactive results table I created. library(DT) library(shiny) library(shinydashboard) library(formattable) ui <- dashboardPage( dashboardHeader(), dashboardSidebar( selectizeInput("v.dependent", "", choices = names(mtcars), selected = "mpg", multiple = FALSE), selectizeInput("predictor", "", choices = names(mtcars),

tabItem cannot show the content when more functions in menuItem using shiny and shinydashboard

跟風遠走 提交于 2019-12-11 10:13:31
问题 I am learning shiny and shinydashboard. My code is like this: library(shiny) library(shinydashboard) library(DT) library(RODBC) library(stringr) library(dplyr) ch<-odbcConnect('B1P HANA',uid='fchen4',pwd='XUEqin0312') sidebar <- dashboardSidebar( sidebarMenu( menuItem("Query1",tabName="Query1",icon=icon("table"), numericInput('Start1','Start Date',19800312,min=20170101,max=20200101), numericInput('End1','End Date',19800312,min=20170101,max=20200101), textInput('Office1','Office ID','0'),

Changing time and dateformat to show correct format on shiny dashboard

女生的网名这么多〃 提交于 2019-12-11 08:11:11
问题 I've build this dashboard with multiple date and time columns however in the dashboard the "T" and "Z" popup in the display Any ideas on how to remove this? I tried as.character , as.factor , anytime but I'm not able to make it happen. Any other ideas are appreciated! 回答1: You can parse it in base R or with lubridate : tz <- Sys.timezone() date1 <- "2015-03-23T13:23:20Z" # With {base} strptime(date1, tz = tz, format = "%Y-%m-%dT%H:%M:%OSZ") [1] "2015-03-23 13:23:20 CET" #With lubridate

Passing a SQL input date range into a query in SHINY

♀尐吖头ヾ 提交于 2019-12-11 07:28:52
问题 I'm learning to use Shiny and shiny dashboard and working with a sql database SQL-SERVER where I'd like to pull the data straight from the database. Essentially the idea is to merge to columns in a table that have a start spot and a stop spot for a date range, tabulate them and then diagram them. I found the following posting on how to pass sql input statements into shiny: How to pass input variable to SQL statement in R shiny? Unfortunately when I try and apply this I get an error 'subscript

Equation wrapping with Shiny Dashboard

ε祈祈猫儿з 提交于 2019-12-11 07:27:27
问题 I just posted a question regarding equation wrapping with shinydashboard here. The answer presented worked, but my actual example is more complicated and includes tabItems . Unfortunately, including the MathJax config at the beginning of the dashboardBody does not wrap the equation when the box is in a tabItem . MWE: library(shinydashboard) library(shiny) # UI ui <- dashboardPage( dashboardHeader(), dashboardSidebar( menuItem( "TEST", tabName = "test", selected = T) ), dashboardBody( tags

Change the border colour of selectinput

左心房为你撑大大i 提交于 2019-12-11 07:06:29
问题 I am trying to change the border colour of a particular selectInput default colour grey to red. After inspecting the HTML I figured out the css parameter that controls the border colour. Then I used HTML tags shown in following code and was able to successfully change the border colour for both the selectInput . The problem is that I want to change the colour only for the first select input i.e Select1 and not Select2 . Is it possible to change the border colour only one particular

Plotting the same output in two tabPanels in shiny

浪尽此生 提交于 2019-12-11 06:59:19
问题 I'm trying to plot the same histogram in two separate tab panels within a tabBox in shiny. I can plot the data in one of the tabs, but then when I add the code for the other it seems to break the app. Below is an example of I'm trying to do: library(shiny) library(dplyr) data(mtcars) body <- dashboardBody( fluidRow( tabBox( title = "miles per gallon", id = "tabset1", height = "250px", tabPanel("Tab1", plotOutput("plot1")), tabPanel("Tab2", plotOutput("plot1"), "test") # the app 'breaks' when

R Shiny: Why doesn't ggplot work?

风格不统一 提交于 2019-12-11 06:57:55
问题 I'm trying to make a plot using ggplot2 for the following data: data Name date weight height Cat1 2016-03-01 34.20000 22.50000 Cat1 2016-04-01 35.02080 23.01750 Cat1 2016-05-01 35.86130 23.54690 Cat1 2016-06-01 36.72197 24.08848 Cat2 2016-03-01 33.55000 22.96000 Cat2 2016-04-01 33.61710 23.41920 Cat2 2016-05-01 33.68433 23.88758 Cat2 2016-06-01 33.75170 24.36534 The code I'm using: library("shiny") library("xlsx") library("ggplot2") animal <- read.xlsx("C:\\data\\animals.xlsx",1) ui<-