课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

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

Excel in R: COUNT

Excel in R: COUNT

- [Instructor] We're using spreadsheet functions to illustrate how R thinks about data. And in this case, let's take a look at the spreadsheet function called count. Now, what count does is return the number of numbers in a range. In cell A9, you'll see the number 34. Well, what I've entered is count. And then I want to count the range A1 through F6. That's six rows and six columns. Well, it should be equal to 36, but it's equal to 34. The reason why is that two of the values in the range A1 through F6 happened to be NA or not available. They're not numbers and so count doesn't return them as numbers and it says there are 34 numbers in the range. Let's take a look at the R equivalent. We're now looking at R and of course the first thing we need to do is import the spreadsheet. So I'm going to use five, which is bring in the library and then number eight, which is import that spreadsheet as a matrix this time. In line…

内容