Tip:
Highlight text to annotate it
X
This video shows how to import data into R Statistical Programming. The R Console here.
The first step I would suggest is to save your data as a comma-separated value. That
can be done, if you have an Excel file, do a save-as .csv. There are ways to import Excel,
but it is easier to just do a save-as in Excel and then do what I'm about to show you. Second
tip is to put your data on a jump drive because that will shorten the file location. If you
have it on your computer, then you're going to end up here in a moment having to type
in a long convoluted location. It's just easier to keep it on the jump drive. So the first
thing, once you've opened up R, is name the data that you're going to import. I'm going
to call it "example", space, and you make a little arrow symbol, space, read, dot, table,
and then you're going to put in the parenthesis and quotation marks. From my location, it's
F slash and then the name of the file, sample data dot csv. And close the quotation marks,
comma, space, header equals true, because I have names at the top of my rows. T R U
E in capitals. "Sep" separation equals, and then quotation marks, put a comma. And close
your parenthesis. Now, this file location here is the file location removable disk F
sample data. If you have trouble finding where that is, go to properties, and the location
F is where it's at. So once you've typed that in, push enter, and if it doesn't give you
any response, you've done it right. You can check to make sure by typing in the file name
you've given it and enter and there is your data. You'll know if you've done it wrong
if you, see, like, I took the parenthesis off the end there and I'm gonna hit enter
and it wants more information. It doesn't know what to do. If you put in something that
it doesn't understand, I think it won't understand that, yep. Error. It doesn't understand that.
So it will give you warnings if you do something wrong. If you do something right, it just
gives you another carrot. So that is how to import your data into R.