Univariate analysis

When dealing with variables, one of the first tasks is to have a global image of how the categories are spread among the individuals.
From this perspective, the package EnQuireR provides two barplot functions: ENbarplot() and XvsYbarplot().

ENbarplot()

ENbarplot() creates a bar plot with horizontal bars with colour shading from the smallest to the highest value.
For each variable, the number of missing values is counted, then the percentage of missing values is printed at the top of the graphical device.

The bar plot can be sorted by alphabetical order when a lot of categories are to be displayed and when the user wants to have a look at a particular category or it can be sorted by frequency when the user wants to have a quick overview of the categories that are the least or most chosen. data(tea)
ENbarplot(tea,X=20,numr=1,numc=1)
ENbarplot(tea,X=20,spl=TRUE,numr=1,numc=1)
#dataset: data set used
#X: the numbers or names of the variables to plot
#spl: if TRUE, the barplots will be sorted per length
#numr: the number of plots per row (by default 2)
#numc: the number of plots per column (by default 2)

Bar plot sorted by alphabetical orderClick to view Bar plot sorted by frequency

XvsYbarplot()

XvsYbarplot() creates a bar plot from a contingency table.
We obtain a bar plot of the variable X depending on the categories of the variable Y. Each category of Y has its own color which is shaded according to the values of X's categories. XvsYbarplot(var1="socio.professionnal.category",var2="sex",dataset=tea,legend.text=TRUE) #var1: name of the first variable
#var2: name of the second variable
#dataset: the data set used
#legend.text: a vector of text used to construct a legend for the plot or a logical indicating whether a legend should be included

The social and economic category according to the gender Click to view