This is weird. I get this error
Error in sort.list(y) : \'x\' must be atomic for \'sort.list\'
Have you called \'sort\' on a list?
From the output of str(cc2), the variable inside of the data.table, V1, is itself a list. This means that cc2 is a nested list of length 1. The error is occurring because table calls sort.list, which requires an atomic vector as input.
Try using unlist:
cc3 <- as.data.frame(table(unlist(cc2)))
unlist will (recursively) extract elements from their list containers. So unlist(cc2) will return a vector, which works directly with table.
I solved it by unlisting cc2 unli <- unlist(cc2) then converted it to df df<-as.data.frame(cc2)
I just needed unlist(myList) for a list I constructed with iterative a list I constructed by index (myList[[i]] <- val) to be able to apply my comparison function of choice (median)