I am trying to do the following, where num.mat
is supposed to be a matrix populated with numeric values.
measurements <<- read.csv(input$Data$datapath, check.names =
F, row.names = 1)
num.mat <<- suppressWarnings(apply(measurements, 2,
as.numeric))
DT::datatable(head(num.mat,20),
options = list(scrollX=TRUE))
Doing:
class(num.mat)
Does indeed return:
[1] "matrix" "array"
I am not sure why when I try to run the code I get the following error message in my R Shiny app (but it could very well be a different problem):
cannot coerce class
c("datatables", "htmlwidget")
to adata.frame
Any ideas would be much appreciated!
Edit: Sorry for not providing more detail in my first post, I have tried to add more context now. I am new to SO and R/RShiny so please tell me if I am still not asking my question correctly. Thank you so much!