problema con mutate no actualiza la columna con la variable

mutate() is interpreting columna as a symbol, not as a character string, the syntax you are trying to use is too ambiguous, you would have to do something like this instead.

library(shiny)
library(tidyverse)

ui <- fluidPage(
    titlePanel("My question"),
    sidebarLayout(
        sidebarPanel(
            selectInput(inputId = "selectedvariable",
                        label = "Select a variable",
                        choices = names(iris))
        ),
        mainPanel(
            DT::dataTableOutput("table")
        )
    )
)

server <- function(input, output) {
    output$table <- DT::renderDataTable({
        iris %>% 
            mutate(!!sym(input$selectedvariable) := !!sym(input$selectedvariable) / 100) %>% 
            head(5)
    })
}

shinyApp(ui = ui, server = server)

Note: Please try to make your questions in English, since it is the preferred language here and by using Spanish you are excluding most people from the conversation, thus lowering your chances of getting help.

1 Like