簡體   English   中英

不能在 HTML 標記中為 R Shiny 使用“for”關鍵字

[英]Cannot use 'for' keyword in HTML tags for R Shiny

我正在嘗試使用 HTML 語法在 R Shiny 中創建自定義單選按鈕。 但是,該標簽使用“for”關鍵字,R 將其解釋為“for loops”中的“for”。

 tags$label(class = 'custom-control-label',
            for = 'customRadio1',
            'Cumulative Graph')

有誰知道如何解決這個問題?

你可以for反引號括起來:

library(shiny)

ui <- fluidPage(
  tags$label(class = 'custom-control-label',
             `for` = 'customRadio1',
             'Cumulative Graph')
)

server <- function(input, output, session) {
}

shinyApp(ui, server)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM