课程: R for Data Science: Lunch Break Lessons

免费学习该课程!

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

Excel in R: DATE

Excel in R: DATE

- [Instructor] I'm using spreadsheets to illustrate some R programming concepts. In this case, let's look at the spreadsheet Date function. And in cell A7 you'll notice that I have a date. It's March 25th, 2021. That cell equals that date because I've used the Date command. And the Date command requires a year, followed by a month, followed by a date. In the table, B1 is the year, B2 is the month, and B3 is the date. Let's take a look at how the R side of this works. So I'm looking at R code now in RStudio, and any time you work with a spreadsheet, you need to import it. Well, in line 5 I use the read_excel package, and I'm going to use Library to bring it into play. And then, in line 7, I import the spreadsheet using read_excel, and then as.data.frame to convert it to an R data frame called Spreadsheet. So when I run that, you'll see that it appears as Spreadsheet. Let's take a quick look at that, and…

内容