...Good day, I'm trying to detect whenever the user enters non numeric data to some inputs and prevent it, my problem is that Im using textinputs and R is not recognizing the data as numeric , tried to convert it with as.numeric and it didn't work, with it R will detect everything as numeric even if its a string.
this is what I'm using in my code:
#textinputs for query data
textInput("Tienda","Tienda"),
textInput("depto","depto"),
textInput("Articulo","Articulo"),
# function in server
if(input$Tienda=="" | input$depto=="" |input$Articulo=="" ){
shinyalert("fill every field", "fill TIENDA,DEPTO Y ARTICULO", type = "error")
}else{
if (!is.numeric(input$depto) | !is.numeric(input$Tienda) | !is.numeric(input$Articulo)){
shinyalert("numeric data only", "fill everything with numeric data", type = "error")
}else{
withProgress({
setProgress(message = "processing...")
my_sql <- gsub("\\?DEP",trimws(input$depto),gsub("\\?STORE_NBR",trimws(input$Tienda),gsub("\\?OLD_NBR",trimws(input$Articulo),my_sql)))
resultset<- dataset.load(name="WM3", query=my_sql)
#resultset <- connector.execute(name="WM3", statement=my_sql)
values$mydata<-resultset
})
any help is appreciated, thanks a lot