课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

今天就开通帐号,24,100 门业界名师课程任您挑!

Factorial

Factorial

- [Instructor] R is a statistical programming language and provides some advanced math features. These are included in the special package which is part of the base installation. So let's take a look at one of these special features called factorial. And this is also gamma L factorial and L gamma. If you're not familiar with factorial there's two things you should know. First of all, if you take a number factorial you can notate that as say for example, seven exclamation which in math indicates seven factorial. What that actually means is one times two times three times four times five times six times seven that would be seven factorial. Seven factorial gives us 5,040. Let's make this easier for us. I can set X equal to seven and we'll go ahead and create that variable. And now if I type in factorial of X I get no surprise, 5,040 which is the factorial of seven or seven factorial. We also have a gamma…

内容