R Lines Function Returning Too Many Random Lines Stack Overflow

R Lines Function Returning Too Many Random Lines Stack Overflow