当我第一次运行任何 R闪亮应用程序时,它会在默认的 R studio 窗口中正确显示。但是,如果我再次运行代码,我会看到一个空白屏幕,如下所示,我必须单击“在浏览器中打开”才能正确显示它。无论代码有多复杂,即使是像下面的代码这样简单的代码,也会发生这种情况。解决此问题的唯一方法是完全重新启动 R Studio。
RStudio 2022.12.0+353 "Elsbeth Geranium" Release
(7d165dcfc1b6d300eb247738db2c7076234f6ef0, 2022-12-03) for Windows
version
_
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 2.2
year 2022
month 10
day 31
svn rev 83211
language R
version.string R version 4.2.2 (2022-10-31 ucrt)
nickname Innocent and Trusting
Run Code Online (Sandbox Code Playgroud)
library("shiny")
ui <- fluidPage(
checkboxGroupInput(inputId="test", label="Test", choices=1:4, inline = TRUE)
)
server <- function(input, output) {
}
shinyApp(ui = ui, server = server)
Run Code Online (Sandbox Code Playgroud)
我之前问过一个问题(请参阅:带毫秒的时间戳序列)但是由于某种原因,当我的时间从 00:00:00 开始时,我的代码不起作用。
我想从一个时间到另一个时间获得 10hz 时间的序列。但是这段代码给了我:
1 2018-06-01 00:00:00.000
2 2018-06-01 00:00:00.101
3 2018-06-01 00:00:00.202
4 2018-06-01 00:00:00.303
5 2018-06-01 00:00:00.404
Run Code Online (Sandbox Code Playgroud)
当我需要时:
1 2018-06-01 00:00:00.000
2 2018-06-01 00:00:00.100
3 2018-06-01 00:00:00.200
4 2018-06-01 00:00:00.300
5 2018-06-01 00:00:00.400
Run Code Online (Sandbox Code Playgroud)
代码:
options(digits.secs=3)
Time1 ="2018-06-01 00:00:00"
Time2 ="2018-06-01 00:00:10"
Time1 =as.POSIXct(Time1, format="%Y-%m-%d %H:%M:%OS", tz='UTC')
Time2 =as.POSIXct(Time2, format="%Y-%m-%d %H:%M:%OS", tz='UTC')
library(stringr)
dif_T2_T1 <- difftime(Time1, Time2, units = 'secs')
pattern <- '(\\d)+'
n <- as.numeric(str_extract(dif_T2_T1, pattern = pattern)) * 10
df_blank <- data.frame(Timestamp = …Run Code Online (Sandbox Code Playgroud)