Crear un marco de datos utilizando la entrada de texto en Shiny
Tratando de crear un marco de datos como abajo;
X Y
20 30
Utilizando textInput para crear el marco de datos.
Pero los valores ingresados en el área de texto no se asignan correctamente al marco de datos.
¿Me podría ayudar?
ui.R
library(shiny)
shinyUI(pageWithSidebar(
headerPanel( "", ""),
sidebarPanel(
wellPanel(
textInput('datavalues', "variable values",""),
actionButton("submit","Apply")
)
),
mainPanel(
verbatimTextOutput('datatable')
)
))
servidor.R
library(shiny)
shinyServer(function(input,output,session){
data1= reactive({
if(input$submit!=0){
isolate({
data.frame(paste(input$datavalues))
})
}
})
output$datatable<-renderPrint(function(){
if(!is.null(data1())){
d<-data1()
print(d)
}
})
})