View source: R/reportfunctions.R
bbgghistplot | R Documentation |
Streamlines plotting of a histogramm using ggplot2
bbgghistplot(
data,
factor,
uniquecounts,
countslab = "Anzahl",
xlabel = NULL,
bin = 1,
facet = NULL,
dens = FALSE
)
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 |
Stefan Bartels, email@biobits.eu
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.