This package contains some convenient graphic functions for the statistical software R.
- R Core 3.6
- devtools package
The function igraph2() depends on the R packages
The function worldmap2() depends on the R packages
The function orcid2name() depends on the R package
To install graphing run the following steps:
- Install and load the devtools package
# Install the devtools package
install.packages("devtools")
# Load the devtools package
library(devtools)
- Install graphing from https://github.com/ingmarboeschen/graphing
# Install graphing from github
install_github("ingmarboeschen/graphing")
The examples listed below are minimal working examples. For a full documentation of each function, check the manual.
x<-sample(letters[1:4],100,T)
y<-sample(1:3,100,T)
# one dimensional absolute frequencies
prettybarplot(table(x))
# two dimensional relative frequencies
prettybarplot(prop.table(table(x,y)))
matrix<-data.frame(matrix(sample(-3:3,1000,T),ncol=10))
names(matrix)<-paste("Item",1:10); g<-paste("Group",rep(1:3,length=100))
for(i in 1:dim(matrix)[2]){matrix[,i]<-factor(matrix[,i],-3:3,c("fully disagree","2","3","4","5","6","fully agree"))}
profileline(matrix,g,main="profileline()",N_legend=T,type="Median",ex=T,xlab="agreement")
profileline(matrix,g,main="",N_legend=T,pch="",type="Mean",ex=T,low="low",high="high",xlab="agreement")
x<-factor(sample(letters[1:6],100,T))
itemplot(x,main="itemplot()",labels=c("I fully\n disagree","I fully\n agree"),legend=F)
itemplot(x,main="itemplot()",labels=c("I fully\n disagree","I fully\n agree"))
x<-sample(paste("group",1:4),100,T)
y<-10+as.numeric(factor(x))*2+rnorm(length(x))
CIV(x,y,main="Confidence Intervall Violin Plot")
x <- sample(paste("time",1:4),240,T)
z <- rep(c("A","B"),each=120)
y <- paste("answer",sample(1:7,240,T))
bp3d(x,z,y,main="bp3d()",xlab="treatment group")
x<-sample(2010:2020,1000,T,.2+(1:11)*.5)
y<-sample(paste("category",LETTERS[1:10]),1000,T)
par(mar=c(4,4,2,5))
stacked.area.chart(table(x,y),main="stacked.area.chart()",ylab="h(x)",xlab="year",reorder=T)
stacked.area.chart(prop.table(table(x,y),m=1),main="stacked.area.chart()",ylab="f(x)",xlab="year")
x<-sample(2010:2020,1000,T,.2+(1:11)*.5)
y<-sample(paste("group",LETTERS[1:10]),1000,T)
catplot(x,y,main="catplot()",xlab="year")
data(ChickWeight)
attach(ChickWeight)
Diet<-paste("Diet",ChickWeight$Diet)
multi.line(x=jitter(Time,2),y=weight,group=Diet,points=T,main="multi.line()",xlab="time",ylab="weight")
multi.line(x=jitter(Time,2),y=weight,group=Diet,points=F,main="multi.line() without points with lowess line",xlab="time",ylab="weight",type="lowess")
x<-list(
c("Laura","Ingmar"),
c("Peter","Renate","Ingmar","Andrea"),
c("Nassim","Ingmar","Sergej"),
c("Laura","Rike","Andra"),
c("Marlene","Nassim","Christina","Sabine"),
c("Bela","Ingmar","Mariola","Nassim"),
c("Gloria","Kim","Olek","Bolek"))
igraph2(x)
x<-list(c("Germany","Austria","S. Korea"),
c("Germany","Austria","S. Korea"),c("Germany","Austria","S. Korea"),
c("Germany","Spain"),c("Germany","Spain"),c("United States","Germany"),
c("Germany","Cuba","Bolivia","South Africa"))
worldmap2(x)
# Note: arguments legend1 and legend2 need adjustments that dependend on the resolution of the resulting graph.
# Note: You need an ORCID account to authenticate to the ORCID api
name<-c("https://orcid.org/0000-0003-1159-3991","Einstein, Albert")
orcid2name(name)