invalid subscript type ‘list’ in R

Simple English Explanation

You have fed a list into a procedure which is expecting a vector. This can be easily addressed via the unlist() function.

This error is very similar to this one. We are feeding a list data type into a process that expects a vector.

Same fix either way – use the unlist() function to unpack the contents of an R list into an R vector. Then feed that into the procedure you were hoping to invoke.

That should fix the problem.

Error: invalid subscript type ‘list’

Scroll to top