Description Usage Arguments Details Author(s) Examples
View source: R/reportfunctions.R
not done yet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | bbbarplot(
data,
factor,
uniquecounts,
countslab = "Anzahl",
xlab = NULL,
xrotate = FALSE,
facet = NULL,
prop = FALSE,
xaxisorder = NULL,
horizontal = FALSE,
stackpar = NULL,
stackreverse = FALSE,
facetncol = 2,
stacktitle = "Gruppe",
facetscales = "free",
cex.datalabel = 2,
datalabel = TRUE,
palette = "main",
palettereverse = FALSE
)
|
data |
the dataframe to use |
factor |
to group the data by |
uniquecounts |
the variable to count |
countslab |
lable of the y-axis |
xlab |
label of x-axis |
xrotate |
if true labels of x-axis are rotation by 90 degree |
facet |
the factor to facet the plot by |
prop |
if true the proportions will be ploted |
xaxisorder |
vector of values to sort the values of "factor" |
horizontal |
if ture a horizontal barplot is ploted |
stackpar |
if the name of a variable is given a stacked barplot will be generated |
stackreverse |
reverse order of stacks |
facetncol |
the amount of column the facet plot is generated to |
stacktitle |
the title of the stacked variable default="Gruppe" |
facetscales |
the scale = "free" |
cex.datalabel |
fontsize of datalabels default=2, |
datalabel |
if true the data will be labeld default=TRUE |
palette |
color palette to use |
palettereverse |
flips the order of colors in palette |
Streamlines the creation of a barplot for primitive counting using ggplot2
Stefan Bartels, email@biobits.eu
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
PatID<-seq(1,13)
PatientWeightClass<-c("61-70","41-50","61-70","41-50","61-70","71-80"
,"81-90","81-90","71-80","81-90","81-90","91-100","61-70")
PatientClass<-c("ClassA","ClassB","ClassB","ClassC","ClassA","ClassC",
"ClassA","ClassB","ClassA","ClassC","ClassA","ClassA","ClassA")
df<-as.data.frame(cbind(PatID,PatientWeightClass,PatientClass))
p1<-bbbarplot(data=df,"PatientWeightClass","PatID",countslab="Anzahl",
xlab=NULL,xrotate=FALSE,stackpar="PatientClass"
,stacktitle="PatientClass",datalabel=TRUE)
p1
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.