Programmers learn & share
0 votes
49 views

Problem :

I am stuck because of following weired error
error in sort.list(y) : 'x' must be atomic for 'sort.list' have you called 'sort' on a list?
by (6.9k points)   | 49 views

1 Answer

0 votes

Solution :

The error is occurring may be because the table calls sort.list, which should have an atomic vector as its input.

Using unlist:

e.g

cc3 <- as.data.frame(table(unlist(cc2)))

Here unlist will extract elements from their list containers. So unlist(cc2) will return the vector, which works directly with table.

So your issue will get resolved.
by (36.1k points)  
2,204 questions
2,608 answers
59 comments
241 users