R 如何排除闪亮书签中的参数?

R 如何排除闪亮书签中的参数?,r,shiny,R,Shiny,我正在创建一个仪表板,我想从书签中排除一些参数 这里有一个MWE: library(shiny) # Define UI for application that draws a histogram ui <- function(request) { fluidPage( # Application title titlePanel("Old Faithful Geyser Data"), # Sidebar with a sl

我正在创建一个仪表板,我想从书签中排除一些参数

这里有一个MWE:

library(shiny)

# Define UI for application that draws a histogram
ui <- function(request) {
    fluidPage(

        # Application title
        titlePanel("Old Faithful Geyser Data"),

        # Sidebar with a slider input for number of bins 
        sidebarLayout(
            sidebarPanel(
                sliderInput("bins",
                            "Number of bins:",
                            min = 1,
                            max = 50,
                            value = 30),
                selectInput(
                    "y",
                    "Year:",
                    choices = 1990:2000,
                    selected = 1990,
                    selectize = TRUE
                )
            ),

            # Show a plot of the generated distribution
            mainPanel(
                plotOutput("distPlot")
            )
        )
    )
}

# Define server logic required to draw a histogram
server <- function(input, output, session) {

    output$distPlot <- renderPlot({
        # generate bins based on input$bins from ui.R
        x    <- faithful[, 2]
        bins <- seq(min(x), max(x), length.out = input$bins + 1)

        # draw the histogram with the specified number of bins
        hist(x, breaks = bins, col = 'darkgray', border = 'white')
    })

    observe({
        # Trigger this observer every time an input changes
        # strip shiny related URL parameters
        grep("selectized", reactiveValuesToList(input), value = TRUE, invert = TRUE)
        session$doBookmark()
    })

    onBookmarked(function(url) {
        updateQueryString(url)
    })
}

# Run the application 
enableBookmarking("url")
shinyApp(ui = ui, server = server)
库(闪亮)
#为绘制直方图的应用程序定义UI

ui您可以在服务器功能中使用
setBookmarkExclude()
(这样就不再需要
grep()
):

setBookmarkExclude(“y-选择”)