lollipoPlot: Lollipop charts

View source: R/lollipoPlot.R

lollipoPlotR Documentation

Lollipop charts

Description

The function generates lollipop or dumbbell dots charts.

Usage

lollipoPlot(values, type = "v", pt.lwd = NULL, pt.col = NULL, ...)

Arguments

values

either a vector, matrix, or data.frame of data. If matrix or data.frame including two columns, a dumbbell dots chart is plotted.

type

plot direction, either vertical ("v", the default) or horizontal ("h").

pt.lwd

points lwd

pt.col

points color

...

other arguments passed to the functions plot, points, and segments.

Details

If a dumbbell dots chart is plotted, different parameters (i.e. col/cex/pch/bg/lwd) for starting and ending points can be supplied. See example for further details.

Author(s)

Silvia Castiglione, Carmela Serio, Pasquale Raia

Examples

require(emmeans)

lollipoPlot(values=feedlot[,4],pt.col="green",pt.lwd=2,lwd=0.8,col="gray20",
            ylab="swt",xlab="samples")

line.col<-sample(colors()[-1],length(levels(feedlot[,1])))
line.col<-rep(line.col,times=table(feedlot[,1]))

lollipoPlot(values=feedlot[order(feedlot[,1]),3],ylab="ewt",xlab="samples",
            bg=as.numeric(as.factor(feedlot[order(feedlot[,1]),2])),
            cex=1.2,pch=21,col=line.col)



lollipoPlot(values=feedlot[order(feedlot[,1]),3:4],type="h",ylab="ewt",xlab="samples",
            pt.col=c("blue","cyan"),cex=1.2,pch=c(3,4),col=line.col)

lollipoPlot(values=feedlot[order(feedlot[,1]),3:4],type="h",ylab="ewt",xlab="samples",
            bg=cbind(line.col,line.col),cex=c(1.2,1),pch=c(21,22))

RRphylo documentation built on June 7, 2023, 5:49 p.m.