Kppatel Patel Kppatel Patel - 1 month ago 9
R Question

DataTable warning table ajax error for some people but not all with shiny

I recieved such error when, in created shiny app in R with DataTables packages in my mobile and one laptop. However, it didn't throw error with other laptops, Same code was working yesterday, and day before yesterday. I haven't changed code, but it is throwing error.

Why there is problem with some devices but not all devices. I used other devices, those devices are not throwing error.

Any idea how to fix this problem? The solution for this problem should be explained here http://datatables.net/manual/tech-notes/7

What is issue ?

Following is thrown error as follows:


DataTables warning: table id=DataTables_Table_0 - Ajax error. For more
information about this error, please see http://datatables.net/tn/7

Answer

I am also suffering. Please take a look at the discussion of this issue #269 on Github.

It seems to be a problem post version 0.1 where you need to "flatten" variables using as.numeric.

ISSUE

Example and solution given by XD-DENG was and to quote them:

"The error is gone when I use

temp <- tapply(iris$Sepal.Length, iris$Species, mean)
  result <- data.frame(species = names(temp),
                       mean = as.numeric(temp))
  return(result)

instead of:

temp <- tapply(iris$Sepal.Length, iris$Species, mean)
  result <- data.frame(species = names(temp),
                       mean = temp)
  return(result)

The main difference is whether the column mean has additional attribution, dimension. This is what caused the error.

But it's still weird given version 0.1 of DT works perfectly on both."

PATCH

@yihui has pushed a fix for this to the dev version so please try update your DT package. (You can use package devtools to install from github devtools::install_github('rstudio/DT'))

I hope this fixes this intermittent error.