swcarpentry / r-novice-inflammation

Programming with R
http://swcarpentry.github.io/r-novice-inflammation/
Other
163 stars 395 forks source link

Episode 3: issue with answer Exponentiation assignment #552

Open kleuveld opened 2 years ago

kleuveld commented 2 years ago

Hi all,

The provided answer to the Exponentiation assignment in Ep 3 only works for exponents greater than 0. I had expected it work at least for exponents of 0, but seq(0) has a length of 2, which was a bit unexpected. Perhaps exponentiation is therefore not the best example of what you can do with loops (at least not before conditionals allow you to test for negative/positive)?

Cheers, koen