To run Rweb just type the R (or Splus) code you want to execute into the text window and then click on the submit button. You will get a new html page with the text output of your code followed by the graphical output (if any) from your code.
Below the submit button is a multiple choice menu of all of the datasets for the book Chance Encounters: A First Course in Data Analysis and Inference by Wild and Seber where you can choose a dataset for your analysis (if you want one). Click to highlight a dataset.
When you click "Submit", the dataset you have highlighted will be read in using read.table with header=T and stored in a dataframe called X. The dataframe, X, will then be attached so you can use the variable names.
You can find out what the variable names are in one of two ways.
Rweb:> names(X) [1] "Id" "EJEC" "SYSVOL" "DIAVOL" "OCCLU" "STEN" "TIME" [8] "OUTCOME" "AGE" "SMOKE" "BETA" "CHOL" "SURG"(Note: Variable names in R are case sensitive, you must use Id, EJEC, and so forth exactly as they appear.)
If you use the back button on your browser to come back to this page you can modify your old code and then resubmit it, or you can clear the text area and type in all new code.
If you need a help with R functions you can use the HTML documentation for the version of R on this server.
Type
hist(length[gender == "female"], right=FALSE)
in the commands box, choose the file coyote.txt from the datasets menu, and submit. Rweb will draw the histogram in Figure 2.3.8 (p. 56) in the textbook (Wild and Seber).
Don't be intimidated by the fact that the command used to produce the
histogram looks complicated. Part of the complication is from the fact
that the histogram is only for part of the data, those individuals with
gender == "female"
. The rest of the complication is from
the fact that there are several ways to draw a histogram and the R defaults
do not exactly match the histogram in the book, which is why we added
right=FALSE
to tell R to put values exactly on a bin boundary
into the upper bin. Typically, we will use the simple command
hist(x)
to draw a histogram of all the values in a variable named x
.
Modified for use at U of M: 10-Sep-2000 by Charles Geyer (charlie@stat.umn.edu)