Error: by must be supplied when x and y have no common variables.
by
x
y
That is the issue.
Can you provide a reproducible example?