RsoFa-summarizing datar

RsoFa-summarizing datar - Loading data and data files into...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Loading data and data files into R: 1. Typing data into R directly: Give each measurement a name. Enter each measurement separately. To do this, type the following all on one line: type that name followed by the less than sign and a dash, making an arrow like so: <- then the letter c then a left parenthesis: ( a right parenthesis may appear to the right of your cursor then the data values, in order, separated by commas if the data is not a number, use quotation marks: “” or apostrophes: ' around each data value make sure there's a right parenthesis at the end! After all the measurements are entered, they need to be joined so that the data for each subject is all in one row. This is done by typing: the name for the data set followed by the less than sign and a dash (another arrow) type the command: data.frame then a left parenthesis then the names of each measurement, separated by commas do NOT put quotation marks or apostrophes around each measurement name 2. Loading data into R from a text document Your text document should be designed as follows: the first line should be the names of the measurements, each one separated by a space then a return the remaining lines should have the value of measurement 1, then a space, then the value of measurement 2, then a space, etc. for all measurements on a subject and remember to hit return to go to the next line for the next subject It's easiest if you put the document in your home folder on the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Mac. If you have a PC, you can find the pathway to your file (which you'll need to enter in) by pressing the right button to get info about your file. Either way, when you save it, make sure it is a text file; i.e. make sure the name of the document ends with: .txt Loading it in: decide on a name for it in R type that name, followed by the less than sign and the dash: <- then type: read.table(“name.txt”, header=T) where “name” is just a stand-in for whatever name you gave the file and it's pathway check to make sure it loaded in correctly by typing in the name you gave it in R, and the table should appear 3. Loading data into R from a spreadsheet Your excel document should be designed as follows: the first row should be the names of the measurements, each one in a separate column the remaining rows should have the all the measurements for
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/28/2012 for the course ECON 111 taught by Professor Aaa during the Summer '11 term at UIBE.

Page1 / 6

RsoFa-summarizing datar - Loading data and data files into...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online