yihui / animation

A gallery of animations in statistics and utilities to create animations
https://yihui.org/animation/
206 stars 60 forks source link

quincunx #119

Closed adeldaoud closed 5 years ago

adeldaoud commented 5 years ago

Hi

Just installed animationand ran the quincunxfunction. But getting the following error:

> quincunx(balls = 10, layers = 15, pch.layers = 2, pch.balls = 19, 
+          col.balls = sample(colors(), balls, TRUE), cex.balls = 2)

Error in sample.int(length(x), size, replace, prob) : 
  object 'balls' not found
In addition: Warning message:
In quincunx(balls = 10, layers = 15, pch.layers = 2, pch.balls = 19,  :
  It's strongly recommended that ani.options(nmax = balls + layers -2)
yulijia commented 5 years ago

In your code, there is a variable called balls at line 2 ( col.balls=sample(colors(),balls,TRUE), you need to set a number to this variable.

adeldaoud commented 5 years ago

Thanks! That helped. I assumed it was set already by the first argument.