Getting started in R for Windows



Getting started in R for Windows

To install R on a Windows machine either copy SetupR.exe from one of the CDs circulating among the class or download it at



Then run SetupR.exe and R should be installed automatically.

Data should be stored in a plain text file. Word files are not plain text files. If you need to edit a data file, you can use Notepad; however, the data files that you download from the Stat Labs web page (the data for the little blue book) are unix files and Notepad doesn’t handle them correctly. You shouldn’t need to edit any of these files (R is quite happy with them), but if you do and you don’t know how to convert a unix file to a Windows file, I can do it for you.

Data files are arranged in rows and columns. The first row of a data file should contain the names of the variables measured in an observation. Each row after the first contains the values of the variables measured in one observation. Each column contains the values of a particular variable for all observations. Numbers should not include commas (write 21234 not 21,234); each row should contain the same number of elements.

Before loading data into R, you need to change the “working directory” to the directory containing the data file. In R, click on [File]. In the File menu, you will see [Change dir]. Click on [Change dir], and you get the “Change directory” window. Type in the path to the directory containing the file and click OK, or use the [Browse] button.

Once you have set the correct working directory, you can load the data. For example, the command

babies ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download