boxplot on RMarkdown

hi, i am trying to construct a box plot for RMarkdown, how will i construct the code:

boxplot(x, data, notch, varwidth, names, main)

if i wish for the graph to look like this (consturcted graph using excel)? thank you!

i already installed ggplot2 package successfully.

correction: "geom_boxplot"

title: "example geom_boxplot"
output: html_notebook


ggplot(mpg, aes(class, hwy,fill=drv)) + 

thank you. i tried following that format but got an error. i wish for it to look like the graph below from excel. may i pls be guided to it? thank you!

apologies, i got it now thank you!

hi question, how come i dont see the title on the output? thanks.

The title is for the document.
did you preview or knit the document ?

yes, that was the output on pdf. even when i tried the sample code above, it showed no title after knitting then viewing the output.

also, after entering the 3 box plots i need, the graph is on the right side after knitting and viewing the output on pdf. may i pls be guided to it?pls see photo below. thank you.

apologies i got the right side already. just the title now. thanks.

hi i already worked out the title. thanks!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.