Description Usage Arguments Value Author(s) See Also Examples
View source: R/pkg.HelperFcns.R
This function takes a dataframe of profile data and prepares a matrix of data for input to barplot()
1 | 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
1 2 3 4 5 6 7 8 9 10 11 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.