课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

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

Excel in R: SUMIF and AVERAGEIF

Excel in R: SUMIF and AVERAGEIF

- [Instructor] I'm using Excel functions to illustrate some R programming concepts. And this week, let's talk about AVERAGEIF and SUMIF. We're looking at a table in a spreadsheet, and in cell B10, you can see the value 4.16. And this is because that's the average, just the simple average of the first row, A1 through F1. If you look down below at B13, you'll see the value 6, and that's because I've inserted the formula AVERAGEIF for the first row, but only average values that are greater than three. So in this case, 2 is not included and 3 is not included, but 8 is included and 5 is included. So what we've actually said is give me the average of eight and five and five. You'll see the equivalent, SUM and SUMIF in column E. The SUM of the first row is 25, but the SUMIF of the first row for all values that are greater than three is 18. So let's take a look at that in R. Now you're looking at R code, and it's in RStudio.…

内容