# Create a matrix of ball locations
# You'd do this using the calls within your points function
balls - matrix(c(0,50,25,-150,-100,-50), ncol=2, byrow=F)
# Draw a line from the origin to each ball location
apply(balls, 1, function(x) lines(c(125, x[1]), c(-210, x[2]), col='red'))
A more
I am using R to plot baseball spray charts from play-by-play data. I have
used the following command to plot the diamond:
plot (0:250, -250:0, type=n, bg=white)
lines(c(125,150,125,100,125),c(-210,-180,-150,-180,-210),
col=c(black))
I have also plotted different hit locations using
?segments
On 9/7/07, lawnboy34 [EMAIL PROTECTED] wrote:
I am using R to plot baseball spray charts from play-by-play data. I have
used the following command to plot the diamond:
plot (0:250, -250:0, type=n, bg=white)
lines(c(125,150,125,100,125),c(-210,-180,-150,-180,-210),