Shiny

How to save a leaflet map with drawn shapes/points on it in Shiny?

我的梦境 提交于 2020-01-10 01:43:12
问题 This question is a follow-up to the questions How to save a leaflet map in Shiny, and Save leaflet map in Shiny. I add a toolbar to draw shapes/points on the map that is addDrawToolbar in the leaflet.extras package. That lets users to draw lines, shapes, ... interactively. In the end I want one to be able to save the map with the drawn shapes as a pdf or png. I have coded up the following making use of the answer to the question: How to save a leaflet map in Shiny. But it does not help

operator is invalid for atomic vectors Error with imported data from SQL to shiny

六眼飞鱼酱① 提交于 2020-01-07 09:20:34
问题 I try to get my raw data from SQL Server using (RODBCext) and then deploy my results to my shinyApp this is my code: #loading Packages library(RODBC) library(shiny) library(rsconnect) library(dplyr) library(RODBCext) #global code #connect to DB Test <- odbcDriverConnect("driver={SQL Server};server=***********;database=*******;uid=*****;pwd=******") #build query Orders<- sqlExecute(Test," SELECT WHWorkOrderHeaderId ,OtherLangDescription FROM Warehouse.WHWorkOrderDetails INNER JOIN Warehouse

operator is invalid for atomic vectors Error with imported data from SQL to shiny

守給你的承諾、 提交于 2020-01-07 09:20:25
问题 I try to get my raw data from SQL Server using (RODBCext) and then deploy my results to my shinyApp this is my code: #loading Packages library(RODBC) library(shiny) library(rsconnect) library(dplyr) library(RODBCext) #global code #connect to DB Test <- odbcDriverConnect("driver={SQL Server};server=***********;database=*******;uid=*****;pwd=******") #build query Orders<- sqlExecute(Test," SELECT WHWorkOrderHeaderId ,OtherLangDescription FROM Warehouse.WHWorkOrderDetails INNER JOIN Warehouse

Use backgroundColor in DT package to change a complete row instead of a single value

时间秒杀一切 提交于 2020-01-07 07:46:32
问题 The answer is probably obvious but i've been looking into using the backgroundColor attribute in the DT package to change the color of the full row instead of only the value that i use to select the row and I didn't manage to do it. So basically in my Shiny app, I have a DataTable output in my server file where i wrote this : output$tableMO <- DT::renderDataTable({ datatable(DFSurvieMO, options = list( displayStart= numerMO()-2, pageLength = 15, lengthChange = FALSE, searching =FALSE)

Thermometer symbol in Shiny

我只是一个虾纸丫 提交于 2020-01-07 07:35:07
问题 I am creating an app using Shiny and would like to include a thermometer plot, created using the symbols() function. I written the following code for my thermometer plot, and it works perfectly fine in the plot viewer in RStudio: symbols(0, thermometers = cbind(0.3, 9, 4.1/9), fg = 2, xlab = NA, ylab = NA, inches = 2.5, axes = F) However, when I try to use this in Shiny, nothing is displayed on the page. Here's my code: server = function(input, output, session) { ... (not needed for this plot

How to highlight a substring containing a random character between two known characters using javascript?

这一生的挚爱 提交于 2020-01-07 05:46:07
问题 I have a bunch of strings in a data frame as given below. v1 v2 ARSTNFGATTATNMGATGHTGNKGTEEFR SEQUENCE1 BRCTNIGATGATNLGATGHTGNQGTEEFR SEQUENCE2 ARSTNFGATTATNMGATGHTGNKGTEEFR SEQUENCE3 I want to search and highlight some selected substrings within each string in v1 column. For example, assuming first letter in the substring being searched as "N" and the last letter as "G", and the middle one could be any letter as in "N A G" or "N B G" or "N C G" or "N D G" and so on. To highlight the

SelectInputUpdate in R? SelectInput in two tabs that are related

让人想犯罪 __ 提交于 2020-01-07 05:36:04
问题 New code example below where I'm trying to link selectInput in all three tabs. In the example below, the first two tabs selectInputs are linked but I'm trying to get all three linked. Is there any way to have all three linked? #`````````````````````````````````````` a <- list("2016", "MALE", "25", "50") b <- list("2017", "FEMALE", "5", "100") c <- list("2017", "MALE", "15", "75") d <- list("2016", "MALE", "10", "35") e <- list("2017", "FEMALE","55", "20") data <- rbind(a,b,c,d,e) #```````````

Reset inputs with reactive app in shiny

孤者浪人 提交于 2020-01-07 03:53:07
问题 I want to add an actionbutton to reset my inputs. For example here, I want all inputs with "All name" "All gender" and "All age" ... I tried with shinyjs but unfortunately doesnt work Any help will be appreciated l <- NULL l$name <- c('b','e','d','b','b','d','e','e','b','b') l$age <- c(20,20,21,21,20,22,22,30,21,32) l$gender <- c('Female', 'Female', 'Male', 'Female', 'Male','Male', 'Female','Male',"Female","Male") l <- as.data.frame(l) l$name <- as.character(l$name) l$age <- as.numeric(l$age)

R jsonlite - fromJSON always returns Error in open.connection?

做~自己de王妃 提交于 2020-01-07 03:11:29
问题 Why do I always get the connection error with fromJSON ? Sometimes it is fine. Most of time it is not. > # Load json and other packages. > library(jsonlite) > > # Live server. > server <- 'http://0.0.0.0:3000' > # Stream 143 > key <- '9p06nngO2pcQM03nIJ71dLXNA1v' > > # Retrieve json data from the data platform via the URLs. > streams <- fromJSON(paste(server, '/output/streams', sep=""), flatten=TRUE) Result: Error in open.connection(con, "rb") : Couldn't connect to server If I try again: >

Initial state of eventReactive()

我与影子孤独终老i 提交于 2020-01-07 03:00:49
问题 I'm using an reactive event in my shiny app, the reactive output is part of a renderDataTable and I want to change the initial outcome of that function. From the documentary I read: "eventReactive() returns NULL until the action button is clicked. As a result, the graph does not appear until the user asks for it by clicking “Go”." But this does not work with my code. Reproductive Example: library(shiny) library(DT) shinyApp( ui = fluidPage( actionButton("go","Go"), DT::dataTableOutput('tbl'))