makeBarplotData {flowPlots} | R Documentation |
This function takes a dataframe of profile data and prepares a matrix of data for input to barplot()
makeBarplotData(profileData, profileColumns, groupVariableName)
profileData |
dataframe of profile data, such as cell categories of cells |
profileColumns |
the columns of profileData to include in the barplot |
groupVariableName |
the column in the dataframe containing the group info |
a matrix whose rows represent different profile categories and whose columns represent different groups. Each cell in the matrix contains the mean value for the group for a given profile category. For profile data with 16 cytokine combinations for each of 2 groups, the matrix returned with have dimensions (16,2).
N. Hawkins, Fred Hutchinson Cancer Research Center, Seattle, WA
data(profileDF) profileDataSubset = subset(profileDF, stim=="LPS" & concGroup==3 & cell=="mDC") profileColumns = 1:16 barplotData = makeBarplotData(profileDataSubset, profileColumns, groupVariableName="group") barplotDataWithLegend = cbind(barplotData, NA, NA) barColors = gray(0:15/15)[16:1] barplot(barplotDataWithLegend, col=barColors, main="Stimulation = LPS Concentration Group = 3 Cell = mDC") legendNames = rownames(barplotData) legend(2.75, 100, legend=legendNames[16:1], col=barColors[16:1], cex=.8, pch=20)