| barplotgr | R Documentation |
The function creates a barplot of numeric vector by one or two factor.
barplotgr(
yvar,
factors,
data = data,
percentage = FALSE,
errbar = !percentage,
half.errbar = TRUE,
conf.level = 0.95,
xlab = NULL,
ylab = NULL,
main = NULL,
names.arg = NULL,
bar.col = "black",
whisker = 0.015,
args.errbar = NULL,
legend = TRUE,
legend.text = NULL,
args.legend = NULL,
legend.border = FALSE,
box = TRUE,
args.yaxis = NULL,
mar = c(5, 4, 3, 2),
...
)
yvar |
The column having the variable to represent the height of the bars. |
factors |
A vector having the columns with the factors to be used in the resulting plot. Notice that the last listed factor, will be used in X-axis plot. |
data |
A data frame having the above described columns. |
percentage |
Logical value, set to |
errbar |
Please set this option to |
half.errbar |
Optional, default set to |
conf.level |
Optional, a numeric value for the confidence interval, the default is 0.95. |
xlab |
Optional, as in the generic barplot function. |
ylab |
Optional, as in the generic barplot function. |
main |
Optional, as in the generic barplot function. |
names.arg |
Optional, as in the generic barplot function. |
bar.col |
Optional, as in the generic barplot function. |
whisker |
Optional, A numeric value, the default is 0.015. |
args.errbar |
Optional, as in the generic barplot function. |
legend |
Optional, as in the generic barplot function. |
legend.text |
Optional, as in the generic barplot function. |
args.legend |
Optional, as in the generic barplot function. |
legend.border |
Optional, as in the generic barplot function. |
box |
Optional, as in the generic barplot function. |
args.yaxis |
Optional, as in the generic barplot function. |
mar |
Optional, as in the generic barplot function. |
... |
list of columns to sort on |
The function returns the above described graph.
Christian Salas-Eljatib
The present function was modified from a similar one available at https://github.com/mrxiaohe/R_Functions/blob/master/functions/bar
data(standtabRauli2)
df <- standtabRauli2
head(df)
barplotgr(yvar = nha.cd, factors = c(bosque.id,cd), data = df,
errbar = FALSE, ylim=c(0, 640))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.