Shiny

VAR model with exogenous variable doesn't work in Shiny

无人久伴 提交于 2020-01-06 06:52:00
问题 Let's consider a VAR model with an exogenous variable to distinguish two periods. This model works perfectly as follows: library(shiny) library(vars) #--- Create Exogenous Variable 'periods' data(Canada) canTS <- Canada periods <- as.matrix(data.frame(period=ifelse(index(canTS)>1996, 1, 0 ) ) ) #--- Fit the Model fit1 <- VAR(Canada, p = 2, type = "none", exogen=periods) coef(fit1)[[1]] #-- Make Prediction period2 <- as.matrix(data.frame(period = rep(1, 12)) ) # Future Exogen Values = 1

Validating the data in TextOutput in Rshiny

六眼飞鱼酱① 提交于 2020-01-06 06:50:12
问题 I have developed a shiny app. But I am not clear about how to validate the text in textOutput. Here, textOutput displays the final value after summing. The required condition is if the value in textOutput is exactly 100, the color of the textOutput should be changed to some color (say aqua green). If the value exceeds above 100 or if it is less than 100, the color should not change. Is there any solution available for this? The Rcode used is as follows : require(shiny) ui = fluidPage(

Any way to display data frame information besides x and y on hover with shiny/ggplot?

倾然丶 夕夏残阳落幕 提交于 2020-01-06 05:59:17
问题 > df <- data.frame(x=c(1,2,3,4,5), y=c(6,7,8,9,10), z=c('a','b','c','d','e')) > df x y z 1 1 6 a 2 2 7 b 3 3 8 c 4 4 9 d 5 5 10 e ggplot(df, aes(x=x, y=y)+ geom_point() Let's say I have a data frame with columns x, y, and z. I create a ggplot with x along the x axis and y along the y axis. I've seen examples of hover code that displays the x and y values when hovering over a point, but is it possible to access other data in the data frame besides what's graphed along x and y? For example if

R, Shiny, Popup Window before App

狂风中的少年 提交于 2020-01-06 05:53:52
问题 i am developing a shiny App that accesses a MySQL Server on Launch and pulls a large amount of data from it. This data is later filtered during the use of the App. Because of the rather large amounts of data transferred the first query takes a lot of time, this is why i would like to create a Dialog / Popup or something similar that opens at the Launch of the App, and lets the user select Settings for a "pre-filter" e.g. only Data from March 2017. Is this possible and if yes, how to do it? I

Is there a “Save Page As PDF” for Shiny app?

梦想与她 提交于 2020-01-06 05:36:08
问题 So I am aware that there is RMarkdown and it is used to generated reports to be printed out in various format (pdf included). I am still very new to R Shiny and will certainly get to RMarkdown soon. However, in the mean time, I am wondering if there is a simple way to print the entire page of an app into pdf, the same way that we normally do for a typical website: 1 - Right-click anywhere on a website to get the popup menu 2 - Select Print 3 - Print As PDF I don't seem to find any discussions

Reactive DateRangeInput for Shiny

早过忘川 提交于 2020-01-06 05:10:09
问题 I'm teaching myself Shiny and I am stuck on my ggplot2 graph not being able to use the reactive dateRangeInput as my x-axis. I have a few questions: Is there a way to use my data frame to grab the min, max values for date range input instead of having to hardcode them in so that when I add more tweets to the data frame I don't have to hardcode the values each time? I am getting the error: Aesthetics must be either length 1 or the same as the data (33108): x, y when I try to use input$date as

R Shiny - dataset load in a first chunk doesn't exist in a second chunk …?

 ̄綄美尐妖づ 提交于 2020-01-06 05:01:48
问题 I have a strange error in a shiny app I built with the library learnr . An error " Object not found " about an object I just loaded and just visualized (meaning the object exists no ?) Although I don't have a reproducible example, some of you will maybe understand what is creating the error : I have a first chunk {r load} that loads a dataset. There is no error here, I can even visualize the dataset (screenshot below) Then I have a second chunk, where I would like to manipulate the dataset.

How to access polygon information from shapefile leaflet R

谁说我不能喝 提交于 2020-01-06 04:51:17
问题 I made a map of London using https://data.london.gov.uk/dataset/statistical-gis-boundary-files-london and shiny and R and leaflet. I added an attribute to the shapefile, and now want to be able to highlight the shapefile and print information when the user clicks on a specific polygon. I looked at shiny leaflet ploygon click event, Marker mouse click event in R leaflet for shiny, and How to implement input$map_marker_click correctly?, and know I need to use ObserveEvent , but have not been

Dynamic UI in shiny: Can't print results from uiOutput created with renderUI

夙愿已清 提交于 2020-01-06 04:33:27
问题 I'm using renderUI in shiny to create text fields depending on the user's selection. The user then fills out the fields and in the simplified version below, the goal is to display the results. How can I get the data from uiOutput? I thought the answer to this question would help: How to get the value in uioutput in ui.R and send it back to server.R? but it doesn't work for my app. library(shiny) ui <- fluidPage( tabsetPanel( tabPanel("data", fluid = TRUE, sidebarLayout( sidebarPanel

How to allow for dynamic amount of file inputs from user in R shiny?

孤人 提交于 2020-01-06 04:14:05
问题 I am looking to allow the user to enter the quantity of files they are interested in uploading, and then having the UI react to give that many file input buttons. I am not certain how to do this. Even once this is completed, I am not certain how best to handle this dynamic amount of variables. #ui.R shinyUI(fluidPage( titlePanel("Upload your files"), fluidRow( column(3, wellPanel( numericInput("user_num_2", label = h4("Number of Old Files"), value = 1) )), column(4, wellPanel( # This outputs