Type & Coercion Errors
Unimplemented type
Matches: unimplemented type '([^']+)' in
WHAT THIS ERROR MEANS
You passed an object type that the function doesn't support. Often happens when passing a list where a vector is expected.
HOW TO FIX IT
1. Check the type with typeof() or class().
2. Convert to the expected type (unlist() for lists → vectors).
3. Extract the specific element you need from the list.
CODE EXAMPLES
BAD — THIS CAUSES THE ERROR
sort(list(3, 1, 2))
GOOD — CORRECT APPROACH
sort(c(3, 1, 2)) # use a vector, not a list
Still stuck?
Paste your code in RChat and the AI will fix this error in context.
RELATED TYPE & COERCION ERRORS
Non-numeric argument to operator You tried to do math (like +, -, *, /) on something that isn't a number, such as...
Argument not numeric or logical A function that expects numbers (like mean, sum, sd) received non-numeric data s...
Cannot coerce type R tried to convert one data type to another but failed because the conversion is...
Invalid argument type An argument you passed to a function is the wrong type. The function expected on...