Shiny

Why is webshot not working with leaflets in R shiny?

北战南征 提交于 2020-01-02 04:48:08
问题 First off webshot isn't working in this context webshot("google.com") for webshot("www.google.com") I get : env: node\r: No such file or directory Error in webshot("google.com") : webshot.js returned failure value: 127 so This isn't working for the leaftlet code staters <<- readOGR(dsn="cb_2015_us_county_20m",layer="cb_2015_us_county_20m") getMap<-function()({ leaflet(staters) %>% addPolygons( stroke = T, fillOpacity =.7, smoothFactor = 0, color = "black", weight = .5, fill = T, fillColor =

ggvis interactive figure does not work as expected using reactive values

拟墨画扇 提交于 2020-01-02 04:43:26
问题 I am having problem with the following example ggvis code which is meant to make a plot that highlights an entire group of points when you hover over any member of that group. I would then like the highlighting to vanish as soon as you hover off. What is happening is that the highlighting initially works but then when you hover off, the highlighting stays, and only vanishes when you hover over another set of points and then hover off them again. library(magrittr) library(dplyr) library(ggvis)

How to give color to a given interval of rows of a DT table?

吃可爱长大的小学妹 提交于 2020-01-02 04:33:11
问题 I am using the DT library to visualize tables, but let's say I want to give a color to some rows like for example RED from row 1 to row 4: Also it would be really nice to change the color of the text if it's possible. After hours of searching I found this function from library DT: datatable(df, rownames = FALSE) %>% formatStyle(columns = "inputval", background = styleInterval(c(0.7, 0.8, 0.9)-1e-6, c("white", "lightblue", "magenta", "white"))) But I need to give color to all columns not just

Shiny/Leaflet map not rendering

守給你的承諾、 提交于 2020-01-02 04:05:31
问题 I can't get a leaflet map to render in my shiny app, although the code works by itself outside of shiny. I do not get any errors so I am stuck, any help is appreciated. Sample Data: cleanbuffalo <- data.frame(name = c("queen","toni","pepper"), longitude = c(31.8,32,33), latitude = c(-24,-25,-26)) Shiny UI: vars <- c( "Pepper" = "pepper", "Queen" = "queen", "Toni" = "toni" ) shinyUI(navbarPage("Buffalo Migration", id ="nav", tabPanel("Interactive Map", div(class="outer", leafletOutput("map",

Buttons: download button with scroller downloads only few rows

风流意气都作罢 提交于 2020-01-02 02:53:07
问题 I am handling tables with more than 100 000 rows and using DT package ( development version 0.1.56 ) to visualize it in Shiny App. Furthermore I am using DT Extensions as: Buttons , to download the data in different formats. However while Scroller extension is as well activated, i am able only to download few rows (not all data). Sample code: library("shiny") library("DT") shinyApp( ui = fluidPage(DT::dataTableOutput('tbl')), server = function(input, output) { output$tbl = DT::renderDataTable

R Shiny: How do you change the background color of the Header?

感情迁移 提交于 2020-01-02 01:16:07
问题 I am writing a shiny application and I would like to customize the look of the header. I am able to add images and format the text, but what I would like to do is change the background color, but only for the header panel, not the rest of the ui. So far I have this for my ui.r: shinyUI(pageWithSidebar( headerPanel( list(tags$head(tags$style("body {background-color: black; }")), "Graphs", HTML('<img src="ah_large_black.gif", height="200px" style="float:right"/>','<p style="color:red"> test

R Shiny automatically start download

浪尽此生 提交于 2020-01-01 19:59:16
问题 I want to initialize the download of a file in R Shiny when a button is pressed and do some checks before generating the file. I've fooled arround with the downloadHandler (https://shiny.rstudio.com/gallery/file-download.html). But I want to catch the event of another button, do some things and checks with the data and when everything went well generate the file and initialize the download without having to press the download button from downloadHandler. I've implemented most checks for now

In Shiny app, how to refresh data from MySQL db every 10 minutes if any change occured

≯℡__Kan透↙ 提交于 2020-01-01 19:54:10
问题 I've made dashboard using shiny, shinydashboard and RMySQL package. Following is what I wrote in order to refresh data every 10 minutes if any change occured. In global.R con = dbConnect(MySQL(), host, user, pass, db) check_func <- function() {dbGetQuery(con, check_query} get_func <- function() {dbGetQuery(con, get_query} In server.R function(input, output, session) { # check every 10 minutes for any change data <- reactivePoll(10*60*1000, session, checkFunc = check_func, valueFunc = get_func

Change the size /spacing of label text in R Shiny fileInput?

拟墨画扇 提交于 2020-01-01 19:28:10
问题 I am working on an R Shiny app, where I have constructed a file input function like so: csvFileInput <- function(name_space, file_name="file", label = "Input file") { ns <- NS(name_space) # doc here: https://shiny.rstudio.com/reference/shiny/latest/fileInput.html fileInput(ns(file_name), label) } Now I am trying to change the font settings of the label supplied here (in the image below, it is "File in"). The font seems too large for longer labels and it sometimes looks clunky. Is there a way

Embed instagram/youtube into Shiny R app

一个人想着一个人 提交于 2020-01-01 19:19:06
问题 I would like to play an instagram or Youtube video upon a click of a graph (e.g. showing what an outlier could be etc) So far, telling Shiny explicitly what the video is works: require(shiny) require(ggplot2) # data df <- data.frame(ID=c(1,2),x=c(33,7),y=c(50,16),name=c("Vid1","Vid2"),link=c("https://www.youtube.com/embed/Gyrfsrd4zK0","https://anotherlink.com"), stringsAsFactors=FALSE) # video is explicitly embedded with the youtube link (i.e. not dynamic) ui <- basicPage( plotOutput("plot",