makeBarplotData: Prepare Profile Data for a Call to Barplot()

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pkg.HelperFcns.R

Description

This function takes a dataframe of profile data and prepares a matrix of data for input to barplot()

Usage

1
   makeBarplotData(profileData, profileColumns, groupVariableName)

Arguments

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

Value

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).

Author(s)

N. Hawkins, Fred Hutchinson Cancer Research Center, Seattle, WA

See Also

GroupListBoxplot

Examples

 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)

flowPlots documentation built on Nov. 8, 2020, 7:54 p.m.