12.07.2015 Views

R dummies

R dummies

R dummies

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 12Getting Data into and out of RIn This ChapterExploring the various ways of getting data into RLooking at how to save your resultsUnderstanding how files are organized in REvery data-processing or analysis problem involves at least three broad steps:input, process, and output. In this chapter, we cover the input and output steps.In this chapter, we look at some of the options you have for importing yourdata into R, including using the Clipboard, reading data from comma-separatedvalue (CSV) files, and interfacing with spreadsheets like Excel. We also give yousome pointers on importing data from commercial software such as SPSS. Next, wegive you some options for exporting your data from R. Finally, you get tomanipulate files and folders on your computer.Getting Data into RYou have several options for importing your data into R, and we cover thoseoptions in this section.Because spreadsheets are so widely used, the bulk of this chapter looks at thedifferent options for importing data originating in spreadsheets. To illustrate thetechniques in this chapter, we use a small spreadsheet table with informationabout the first ten elements of the periodic table, as shown in Figure 12-1.Entering data in the R text editorAlthough R is primarily a programming language, R has a very basic dataeditor that allows you to enter data directly using the edit() function.Figure 12-1: A spreadsheet with elements of the periodic table serves as our example

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!