We will have another R session this week, likely tomorrow. I will let you know when I have booked a room. Wayne suggested we work on a little script to make some boxplots. You can find the script itself here: http://openwetware.org/wiki/Shreffler:Resources#R_analysis (it's called BasoAct_Boxplots.R). You can also find the input data file there.
But if you want to tackle it yourself, below are some instructions to get you going. Download the data file from the lab wiki. The boxplots that the script generates (what you're 'aiming for') are attached to this email:
We start with a data file containing information about subjects' clinical response to milk challenge, and the rates of their basophil activation (%CD63+ cells) to successive dilutions of milk stimulant and to control stimulants . The following lines of code load the file into R, and then create separate data frames of the responses to milk stimulants and the responses to control stimulants.
v0 <- read.csv("20080818_BaselineBasoDataWithClinicalGroups.csv")
milk <- subset(v0, stim == "Milk1" | stim == "Milk2" | stim == "Milk3" | stim == "Milk4" | stim == "Milk5")
- write to directory then read back in ... the plots turn out funny without these commands (try it) write.csv(milk, "milk_only.csv")
milk <- read.csv("milk_only.csv") ctrls <- subset(v0, stim == "Anti-IgE" | stim == "IL-3" | stim == "PMA/CaI" | stim == "fMLP")
- write to directory then read back in ... the plots turn out funny without these commands (try it) write.csv(ctrls, "ctrls.csv")
ctrls <- read.csv("ctrls.csv")
The %CD63+ gate is represented in each data frame by variable Q2. We would like to generate boxplots compare the responses to these stimulants between study subjects grouped by response to food challenge ("Clinical_Group")
1. Prepare a data structure that contains the aggregated data by clinical group for each milk stimulant (there should be 25 sets of information) - you can use the example from lesson 2. 2. Open a new 10x5 quartz window to display your output. 3. Prepare a basic boxplot of the 25 boxes 4. Now explore the options in the "boxplot" function, as well as "title", "mtext" and "abline" functions, to manipulate the graphical features of the plot - within "boxplot" you can use the "array" function to label the tick marks on the x axis. 5. Creating the graph of the control stimulants is similar, but we will need to put the x-axis labels side-on to fit them."
Lara Ford, MD Fellow, Allergy and Immunology Mount Sinai School of Medicine One Gustave L. Levy Place Box 1198 New York, NY 10029
Click on a date/time to view the file as it appeared at that time.
|current||07:33, 22 September 2009||(332 KB)||Wayne G. Shreffler||Hi All, We will have another R session this week, likely tomorrow. I will let you know when I have booked a room. Wayne suggested we work on a little script to make some boxplots. You can find the script itself here: http://openwetware.org/wiki/Shreffler|
- You cannot overwrite this file.