Type error. I assume that the equality operator between head(A) and head(C) is intended to be a comparison. But merge does not return a boolean result. It returns a list.