我有几个
tabPanel()
ui.R
选项卡面板()
在后台加载初始选项卡后,有没有办法预加载这些页面?
我试图在服务器功能的底部包括以下内容:
sapply(names(outputOptions(output)),function(x) outputOptions(output, x, suspendWhenHidden = FALSE))
我尽量避免放置
renderPlot
在一个
observer
reactiveVariable
该转换用于一系列绘图。在结构上更容易放置
reactiveValue
在
观察者
Data = reactivePoll(5479,
session,
checkFunc = function() {
if (file.exists(orderStatsPath))
file.info(orderStatsPath)$mtime[1]
else
""
},
valueFunc = function() getData(orderStatsPath)
)
observe({
Data = Data()
Data = subset(Data, subset = Date >= Sys.Date() - 14)
Data$Date = as.character(Data$Date)
output$slippageRootTotalUSD = shiny::renderTable({
result = dcast(Data,
Date ~ Symbol,
value.var = "slippageRootTotalUSD",
na.rm = T,
fun = sum,
margins = c("Date","Symbol"))
rownames(result) = result[,1]
result = signif(result[,-1],5)
result
},
rownames = TRUE,
hover = TRUE,
digits = 2,
spacing = 's'
)
output$SizeUSD = shiny::renderTable(
{
result = dcast(Data,
Date ~ Symbol,
value.var = "SizeUSD",
na.rm = T,
fun = sum,
margins = c("Date","Symbol"))
rownames(result) = result[,1]
result = round(result[,-1],0)
result
},
rownames = TRUE,
hover = TRUE,
digits = 0,
spacing = 's'
)
sapply(names(outputOptions(output)),function(x) outputOptions(output, x, suspendWhenHidden = FALSE))
}