Error in .Internal(as.vector(x, "symbol")) : 'x' is missing