Are you sure you’re using 4.8? This definitely works in 4.8 but in 4.7 or below you will see the “all arguments should be the same length” error.
The other possibility is that you’re passing something into y which is not a valid column name.