Shiny

Error in Shiny deployment on shinyapps.io

可紊 提交于 2021-02-18 18:15:11
问题 I got a Shiny App that works fine on my PC, but once I deploy on shinyapps.io it shows the following error on the web browser: And the following error on the Deployment Console: Warning message: In value[[3L]](cond) : Failed to parse C:/Users/david.jorquera/AppData/Local/Temp/RtmpSOqdYV/file13849671673/app.R ; dependencies in this file will not be discovered. If you need the exact excel file I'm using I would happily attach it if you tell me how to do it (sorry, haven't figure that out yet).

Python装饰器(decorator)不过如此,是我想多了

半腔热情 提交于 2021-02-18 16:45:13
摘要: Python装饰器是Python中一个非常有趣的特性,可以利用Python装饰器对一个函数包装再包装,其实从效果上看有一点像AOP中的切面,也就是对函数调用进行拦截,那么通过Python装饰器可以做哪些有趣的事情,以及Python装饰器的原理是什么呢?继续看本文吧! 1. 叠加使用Python装饰器 最近有学员问,Python中也有与Java类似的@xxxx语法,这到底是什么意思呢?现在我就来回答这个问题。 Java中的@xxxx语法是注解(Annotation),而Python中的@xxxx语法是装饰器(decorator),尽管在语法上类似,但作用完全不同。Java的注解相当于语法元素(方法、类、接口等)的元数据。而Python的装饰器是对Python函数(方法)的包装,现在我们来举个例子。 @makebold @makeitalic def say () : return "Hello" print(say())) 这段代码,对函数say使用了2个装饰器:@makebold和@makeitalic,而且是叠加状态。@makeitalic会首先作用于say函数,然后@makebold会作用于@makeitalic装饰器的结果,这两个装饰器分别用<b>...</b>和<i>...</i>包装say函数返回的字符串,所以这段代码的执行结果如下: < b > < i >

dynamically add rows to rhandsontable in shiny and R

假如想象 提交于 2021-02-18 15:57:26
问题 I'm trying to create an app which ultimately needs the mean and sd of a protein's concentration on the log scale . Since the log-scale values are almost never reported, I've found references which allow me to approximate log-scale using commonly available data (the mean + sd, median + range, median + IQR, 5 point summary, etc.). Users will enter the data using a table currently implemented using rhandsontable until I've added enough error handling to accommodate CSV files, and I want to limit

dynamically add rows to rhandsontable in shiny and R

白昼怎懂夜的黑 提交于 2021-02-18 15:57:10
问题 I'm trying to create an app which ultimately needs the mean and sd of a protein's concentration on the log scale . Since the log-scale values are almost never reported, I've found references which allow me to approximate log-scale using commonly available data (the mean + sd, median + range, median + IQR, 5 point summary, etc.). Users will enter the data using a table currently implemented using rhandsontable until I've added enough error handling to accommodate CSV files, and I want to limit

Using Shiny fileInput to get path only

岁酱吖の 提交于 2021-02-18 15:31:47
问题 I have a very large fixed width file I need to read in using my Shiny application. The way my program is currently structured is the ui.R contains a fileInput allowing the user to locate the file using the browser. On the server side, I only capture the path to the file such as the following: path2file <- reactive({ infile <- input$path2file if (is.null(infile)) return(NULL) infile$datapath }) A subsequent function takes that path as input and the proceeds to read in the file according to its

Using Shiny fileInput to get path only

蓝咒 提交于 2021-02-18 15:31:32
问题 I have a very large fixed width file I need to read in using my Shiny application. The way my program is currently structured is the ui.R contains a fileInput allowing the user to locate the file using the browser. On the server side, I only capture the path to the file such as the following: path2file <- reactive({ infile <- input$path2file if (is.null(infile)) return(NULL) infile$datapath }) A subsequent function takes that path as input and the proceeds to read in the file according to its

R Shiny Dashboard Scroll to Top on Button Click

北战南征 提交于 2021-02-18 12:46:11
问题 Is there any way to scroll to the top of the page in ShinyDashboard on a button click? I've added the following lines in ui.R under dashboardSidebar( : useShinyjs(), extendShinyjs(text = "shinyjs.button = function() {document.body.scrollTop = 0;}"), and the following in server.R under observeEvent(input$button, { : js$button() This seems to work in the app preview in RStudio, but not in browser. 回答1: Using the first Google hit for "javascript scroll to top", the most upvoted answer is window

Keep formatting when exporting table with DT (DataTables buttons extension)

扶醉桌前 提交于 2021-02-18 12:37:26
问题 I made a shiny app where someone uploads a file, some ratios are computed, and those ratios can be formatted using sliders for thresholds. I use DT::formatStyle for this and it is working really fine. As far as I understand this function, it creates a callback to handle the conditional formatting. Then, I want to export the data, using the buttons extension in DT . I want to keep the formatting when exporting to pdf or printing. It turns out that this doesn't work: the data is exported

R DT Horizontal scroll bar at top of the table

◇◆丶佛笑我妖孽 提交于 2021-02-18 12:32:14
问题 I have a wide and lengthy DT in shiny. By default I would like to show the horizontal scroll bar on top of the table. Is there a way to do this? My current DT definition looks like below: DT::datatable(dt, rownames = FALSE, filter = fbox, style = "bootstrap", options = list( dom = dom, scrollX = TRUE, columnDefs = list(list(orderSequence = c('desc', 'asc'), targets = "_all")), processing = FALSE, pageLength = 500, lengthMenu = list(c(500, 1000, 5000), c("500","1000","5000")) ), callback = DT:

R DT Horizontal scroll bar at top of the table

ぐ巨炮叔叔 提交于 2021-02-18 12:31:44
问题 I have a wide and lengthy DT in shiny. By default I would like to show the horizontal scroll bar on top of the table. Is there a way to do this? My current DT definition looks like below: DT::datatable(dt, rownames = FALSE, filter = fbox, style = "bootstrap", options = list( dom = dom, scrollX = TRUE, columnDefs = list(list(orderSequence = c('desc', 'asc'), targets = "_all")), processing = FALSE, pageLength = 500, lengthMenu = list(c(500, 1000, 5000), c("500","1000","5000")) ), callback = DT: