Thursday, September 4, 2008

Some common problems in R and Fathom

Here are some common questions I've heard recently about R and Fathom.

1.  Some of you are having problems reading in datafiles which is a big concern.  There are two ways you can mess up.  

(a)  First, it is important that R can find your files.   Put all of your R work in a particular folder, say EDA, and then by choosing menu item File -> Change dir ..., you select the file EDA.  To check if the working directory really has changed, type

dir()

and you should see your data files.

(b)  A general form to read in a text datafile is

data=read.table(file.name, header=T, sep="\t")

where file.name is in double-quotes.  The header option says that the first line in the file contains the variable names and the sep option says that columns are separated by the tab character.

2.  How do you plot curves on Fathom?  

Suppose you have created a scatterplot and wish to add a curve.  You select the graph and choose the menu item Graph -> Plot Function.  Then you just type the function (using the variable name on the x axis) in the box.


No comments: