bbgghistplot: bbgghistplot

View source: R/reportfunctions.R

bbgghistplotR Documentation

bbgghistplot

Description

Streamlines plotting of a histogramm using ggplot2

Usage

bbgghistplot(
  data,
  factor,
  uniquecounts,
  countslab = "Anzahl",
  xlabel = NULL,
  bin = 1,
  facet = NULL,
  dens = FALSE
)

Arguments

data

dataframe

factor

the column to count

uniquecounts

the column that determines the unique id

countslab

label of y axis default="Anzahl"

xlabel

label of x axis default=NULL

bin

bandwidth default=1

facet

if given the plot wil be printed as facets default=NULL

dens

if TRUE a density plot wil be performed default=FALSE

Author(s)

Stefan Bartels, email@biobits.eu

Examples

## Not run: 
PatID<-seq(1,50)
PatientWeight<-runif(50, min=40, max=100)
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")
PatientClass2<-seq(1,50,50)
df<-as.data.frame(cbind(PatID,PatientWeight,PatientClass))
p1<-bbgghistplot(data=df,"PatientWeight","PatID",countslab="Anzahl",bin=10)
p1

## End(Not run)


biobits/bbreportr documentation built on Feb. 14, 2025, 11:56 p.m.