小编Jes*_*sse的帖子

页面加载时的闪亮submitButton行为

提交按钮很有用,但我还没有找到一种优雅的方法来抑制初始页面加载时的输出.

例如,Shiny教程在加载时呈现输出.
http://rstudio.github.com/shiny/tutorial/#more-widgets

在按下提交按钮之前,如何确保不会调用任何反应函数?

以下是上面链接的示例的内联代码.

#ui.R
library(shiny)

# Define UI for dataset viewer application
shinyUI(pageWithSidebar(

  # Application title.
  headerPanel("More Widgets"),

  # Sidebar with controls to select a dataset and specify the number
  # of observations to view. The helpText function is also used to 
  # include clarifying text. Most notably, the inclusion of a 
  # submitButton defers the rendering of output until the user 
  # explicitly clicks the button (rather than doing it immediately
  # when inputs change). This is …
Run Code Online (Sandbox Code Playgroud)

r shiny

11
推荐指数
1
解决办法
7609
查看次数

使用子集从data.frame中删除列的列表

我经常需要从data.frame中删除列列表.

我经常这样做:

to.remove <- c("hp","drat","wt","qsec")
mtcars[,-which(names(mtcars) %in% to.remove)]
Run Code Online (Sandbox Code Playgroud)

哪个工作正常.

但我希望能够以更清洁的方式使用subset.但它似乎附加了data.frame,然后将列名称作为变量而不是字符串来访问.

例如,这是我希望能够做到的:

subset(mtcars,select=-to.remove)
Run Code Online (Sandbox Code Playgroud)

有没有办法强制subsetselect语句中使用字符串向量?还是有另一个更好的选择吗?

r dataframe

8
推荐指数
2
解决办法
2万
查看次数

如何:_*将有序集合转换为变量arg列表?

我一直在使用:_*转换Seq[String]String*,我意识到,我不明白这是如何工作的引擎盖下.

有没有一种简单的方法来考虑这个?

scala syntactic-sugar

6
推荐指数
1
解决办法
138
查看次数

标签 统计

r ×2

dataframe ×1

scala ×1

shiny ×1

syntactic-sugar ×1