I have two buttons in my Ui file submitButton("Analysis"),width=6,downloadButton('downloadData', 'Download Data')) Which gives the following output as the app However I am trying to align these buttons so that the download data is right aligned and the analysis button is on the left, instead of how it looks now. How do i go about this? You can do the following. Please look into shiny 4 s
我的Ui文件中有两个按钮 submitButton("Analysis"),width=6,downloadButton('downloadData', 'Download Data')) 其中以应用程序的形式提供以下输出 不过,我正在尝试对齐这些按钮,以便下载数据右对齐,分析按钮位于左侧,而不是现在的样子。 我如何去做这件事? 您可以执行以下操作。 请同时查看闪亮的4个小文本输入框 library(shiny) ui =fluidPage( div(style="display:inline-block",submitButton("Analysis"),w
I have some trouble with a script which uses cbind to add columns to a data frame. I select these columns by regular expression and I love that cbind automatically provides a prefix if you add more then one column. Bit this is not working if you just append one column... Even if I cast this column as a data frame... Is there a way to get around this behaviour? In my example, it works fine f
我在使用cbind将列添加到数据框的脚本中遇到了一些麻烦。 我通过正则表达式选择这些列,我爱如果添加多个列,cbind会自动提供前缀。 如果你只是附加一列,那么这个工作不起作用......即使我将这一列作为数据框架... 有没有办法解决这个问题? 在我的例子中,它适用于以a开头但不适用于b1列的列。 df <- data.frame(a1=c(1,2,3),a2=c(3,4,5),b1=c(6,7,8)) cbind(df, log=log(df[grep('^a', names(df))])) cbind(df, lo
Here is my original data frame: df <- read.table(text=" Date Index Event 2014-03-31 A x 2014-03-31 A x 2014-03-31 A y 2014-04-01 A y 2014-04-01 A x 2014-04-01 B x 2014-04-02 B x 2014-04-03 A x 2014-09-30 B x", header = T, stringsAsFactors = F) date_range <- seq(as.Date(min(df$Date)), as.Date(max(df
这是我的原始数据框架: df <- read.table(text=" Date Index Event 2014-03-31 A x 2014-03-31 A x 2014-03-31 A y 2014-04-01 A y 2014-04-01 A x 2014-04-01 B x 2014-04-02 B x 2014-04-03 A x 2014-09-30 B x", header = T, stringsAsFactors = F) date_range <- seq(as.Date(min(df$Date)), as.Date(max(df$Date)),
I have written a package using S4 classes and would like to use the functions rbind, cbind with these defined classes. Since it does not seem to be possible to define rbind and cbind directly as S4 methods I defined rbind2 and cbind2 instead: setMethod("rbind2", signature(x="ClassA", y = "ANY"), function(x, y) { # Do stuff ... }) setMethod("cbind2", signature(x="ClassA", y = "ANY")
我已经使用S4类编写了一个包,并希望使用这些定义的类的函数rbind,cbind。 由于似乎无法将rbind和cbind直接定义为S4方法,我改为定义了rbind2和cbind2 : setMethod("rbind2", signature(x="ClassA", y = "ANY"), function(x, y) { # Do stuff ... }) setMethod("cbind2", signature(x="ClassA", y = "ANY"), function(x, y) { # Do stuff ... }) 从?cbind2我了解到,这些函数需要使用methods:::bin
How can I remove the borders around bars in R, so that only the fill remains? Instead of this: I want this: I do not want to color the borders! 您可以将此参数设置为hist的额外选项,如lty="blank" : hist(rnorm(100), lty="blank", col="hotpink")
我如何去除R中的小节边界,以便只填充剩余的? 取而代之的是: 我要这个: 我不想为边框着色! 您可以将此参数设置为hist的额外选项,如lty="blank" : hist(rnorm(100), lty="blank", col="hotpink")
I am trying to get plotGoogleMaps when using Shiny working in Internet Explorer as well as Google Chrome, and was wondering what I need to do to fix it. The code I am using uses the answer to a different question The code works when Chrome is the browser, but doesn't work when IE is the browser. To repeat the code again here it is: library(plotGoogleMaps) library(shiny) runApp(list(
我试图在使用Shiny在Internet Explorer和Google Chrome浏览器中工作时试图获得plotGoogleMaps,并且想知道我需要做些什么来修复它。 我正在使用的代码使用不同问题的答案 当Chrome浏览器时,该代码有效,但IE浏览器不起作用。 重复这里的代码是这样的: library(plotGoogleMaps) library(shiny) runApp(list( ui = pageWithSidebar( headerPanel('Map'), sidebarPanel(""), mainPanel(uiOutput('mymap')) ),
This question is related to this one that I asked before. But referring to that question is not necessary to answer this one. Data I have a data set containing velocities of 2169 vehicles recorded at intervals of 0.1 seconds. So, there are many rows for an individual vehicle. Here I am reproducing the data only for the vehicle # 2: > dput(uma) structure(list(Frame.ID = 13:445, Vehicle.
这个问题与我以前问过的这个问题有关。 但提到这个问题没有必要回答这个问题。 数据 我有一个数据集,其中包含以0.1秒为间隔记录的2169辆车辆的速度。 所以,单个车辆有很多排。 在这里,我仅复制车辆#2的数据: > dput(uma) structure(list(Frame.ID = 13:445, Vehicle.velocity = c(40, 40, 40, 40, 40, 40, 40, 40.02, 40.03, 39.93, 39.61, 39.14, 38.61, 38.28, 38.42, 38.78, 38.92, 38.54, 37.51, 36.34, 35
I have a shiny program in R that works great. But I am having trouble deploying it to shinyapps.io. The javascript error console gives me the following error: Listening on http://127.0.0.1:46574 Downloading github repo jlisic/saAlloc@master Installing saAlloc '/usr/lib/R/bin/R' --vanilla CMD INSTALL '/tmp/RtmpvmoFM3/devtools2c6b564aad/jlisic-saAlloc-62692fc' --library='/usr/loca
R中有一个闪亮的程序,效果很好。 但是我在将它部署到shinyapps.io时遇到了问题。 javascript错误控制台给我以下错误: Listening on http://127.0.0.1:46574 Downloading github repo jlisic/saAlloc@master Installing saAlloc '/usr/lib/R/bin/R' --vanilla CMD INSTALL '/tmp/RtmpvmoFM3/devtools2c6b564aad/jlisic-saAlloc-62692fc' --library='/usr/local/lib/R/site-library' --install-tests Error:
I seem to misunderstand tail recursion; according to this stackoverflow question R does not support tail recursion. However, let's consider the following functions to compute the nth fibonacci number: Iterative version: Fibo <- function(n){ a <- 0 b <- 1 for (i in 1:n){ temp <- b b <- a a <- a + temp } return(a) } "Naive
我似乎误解了尾递归; 根据这个stackoverflow问题R不支持尾递归。 但是,让我们考虑以下函数来计算第n个斐波纳契数: 迭代版本: Fibo <- function(n){ a <- 0 b <- 1 for (i in 1:n){ temp <- b b <- a a <- a + temp } return(a) } “天真”递归版本: FiboRecur <- function(n){ if (n == 0 || n == 1){ return(n) } else { re
For some reasons, I'd like to play with R calls (at least as far as syntax is concerned) in a more Lisp/Scheme-like fashion (we all know that R has been heavily inspired by Scheme). Thus, I set up the following function: . <- function(f, ...) eval(match.call()[-1], envir=parent.frame()) Which allows me to express eg the following R code: x <- sort(sample(1:10, 5, replace=TRUE))
出于某些原因,我想以更类似Lisp / Scheme的方式(至少就语法而言)使用R调用(我们都知道R受到Scheme的强烈启发)。 因此,我设置了以下功能: . <- function(f, ...) eval(match.call()[-1], envir=parent.frame()) 这允许我表达例如以下R代码: x <- sort(sample(1:10, 5, replace=TRUE)) for (i in x) { print(1:i) } 在下面的语义等同形式中: .(`<-`, x, .(sort, .(sample, .(`:`