课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

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

Excel in R: COUNTIF

Excel in R: COUNTIF

- [Instructor] We've been using Excel functions to illustrate our programming concepts. This week, let's talk about the Excel function called COUNTIF. And we're looking at a spreadsheet right now. it's three rows of text from the "Jabberwocky" poem. And down in cell B7, you can see that I've set up a formula COUNTIF and then a range followed by "b*". And what this is saying is look in the range from A1 to G4 and count all of the words that begin with b. In this case, you can see that B1 is the word brillig, which starts with b, and cell E3 is borogoves, which also starts with b. So let's take a look at R and learn how to duplicate this functionality. We're looking at R in RStudio, and the first thing that we have to do with spreadsheets is bring in the readxl package. So I've selected line five, and I'm going to hit Run. And then in line seven, I'm going to import the data from the spreadsheet. And you can see…

内容