对于 cols 变量中选择的所有 4 列,如果值大于(或等于)1.5,我想将它们设置为 1,否则为 0
我尝试过类似的事情:iris[(cols) > 1.5 , (cols) := 1, .SDcols = cols]
谢谢
在我闪亮的应用程序中,我有一个允许更改主题应用程序的选项。
有没有办法创建一个主题,其中只有导航栏是彩色的,而主体是黑色或白色的?
我知道可以使用 CSS 来完成此操作,但由于我可以更改应用程序中的主题,因此无法进行自定义修复。
library(shiny)
library(markdown)
library(bslib)
main_theme = bslib::bs_theme(
bg = "#86cecb",
fg = "#e12885",
primary = "#89cff0",
)
ui = navbarPage(
"Navbar!",
theme = main_theme,
tabPanel("Plot",
sidebarLayout(
sidebarPanel(radioButtons(
"plotType", "Plot type",
c("Scatter" = "p", "Line" = "l")
)),
mainPanel(plotOutput("plot"))
)),
navbarMenu(title = "Ressources",
tabPanel(
"Options d'interface",
selectInput(
"theme",
"Themes :",
c(
"Custom" = "custom",
"Dark" = "dark",
"Light" = "light"
)
)
))
)
server = function(input, output, session) {
light <- bs_theme()
dark <- bslib::bs_theme(
bg …Run Code Online (Sandbox Code Playgroud)