课程: Complete Guide to R: Wrangling, Visualizing, and Modeling Data

今天就学习课程吧!

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

Entering data

Entering data

- [Instructor] By far, the easiest way to get a dataset of any meaningful size into R is to import it, and I'm going to talk about that, but I want to show you first how for very small sets of data, for a particular variable or a particular calculation, it may be easiest to enter the data directly into R through the script window. Let me show you how this works. I'm going to use this script about entering data, and let's come down to this first basic command. You can do basic math, here I have two plus two. And to run that command, I'm going to hold down Cmd or Ctrl and hit the enter or return key. When I do that, I get the result down here in the console. Now, the one in square brackets is not the result. That's an index number and that's there because R puts the results into vectors and it's telling you which item is the first one on that line. Now, there's only one, so we just have the index number one, but we also see that two plus two is equal to four. It's nice to know that R…

内容