课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

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

Excel in R: SUM

Excel in R: SUM

- [Instructor] This is a spreadsheet, and this is R. Many data scientists got their start using spreadsheets, and are intimately familiar with the functions required to manipulate data in a spreadsheet environment. What I'd like to do over the next couple of weeks is show you how to transfer that knowledge from a spreadsheet environment to the R environment. And to do that, I'm going to show you functions that are most frequently used in a spreadsheet, and then we'll duplicate them in R. Let's start with sum. Here's my spreadsheet. It's just numbers. And in order to do sum, you type in =sum, and then you give it a range. So in this case I'm going to get all the values in the first row, A1 through F1. Parentheses, return, and I get the sum of the first row. Now, how do we do that in R? Well, the first thing you'll need to do is load a library called read_excel, and what that's going to do is bring in a package…

内容