Hi,
Using ggplot function in a shiny output, i receive this warning only when x-axis is reduced to single factor.
" Input to asJSON(keep_vec_names=TRUE) is a named vector. In a future version of jsonlite, this option will not be supported, and named vectors will be translated into arrays instead of objects. If you want JSON object output, please use a named list instead. See ?toJSON. "
If x-axis is > 1 factor, works without warning.
I tried to convert my dataset(dataframe) in a named list :
df <- data.frame(table(type))
colnames(df) <- c("Var1", "Var2")
df$Var1 <- fct_rev(df$Var1)
dataset <- list(df)
names(dataset) <- "Test"
Then use the ggplot function but nothing changes :
graph <- ggplot(dataset$Test, aes(x=Var1, y=Var2))
graph_dyn <- graph + coord_flip()
graph_dyn
If not possible, is there a way to not display the Json warning in the console?
options(warn=-1) # not working