How would you program Pascal's triangle in R?

Posted by Peter Flom on Stack Overflow See other posts from Stack Overflow or by Peter Flom
Published on 2010-04-13T19:08:34Z Indexed on 2010/04/13 19:13 UTC
Read the original article Hit count: 211

Filed under:

I am reading, on my own (not for HW) about programming, and one exercise involved programming Pascal's triangle in R. My first idea was to make a list and then append things to it, but that didn't work too well. Then I thought of starting with a vector, and making a list out of that, at the end. Then I thought of making a matrix, and making a list out of that at the end.

Not sure which way to even approach this.

Any hints?

thanks

© Stack Overflow or respective owner

Related posts about r