Question

    Basic syntax to create a bar-chart in R is

    A barplot(H, xlab, ylab, main) Correct Answer Incorrect Answer
    B barplot(H, xlab, names.arg, col) Correct Answer Incorrect Answer
    C barplot(H, xlab, ylab, main, names.arg, col) Correct Answer Incorrect Answer
    D barplot(H, xlab, ylab) Correct Answer Incorrect Answer
    E None Correct Answer Incorrect Answer

    Solution

    barplot(H, xlab, ylab, main, names.arg, col) where H is a vector or matrix which contains numeric values used in bar chart. xlab is the label for x axis. ylab is the label for y axis. main is the title of the bar chart. names.ar g is a vector of names appearing under each bar. col is used to give colours to the bars in the graph. Example : c(7,12,28,3,41)

    Practice Next