diff options
Diffstat (limited to 'exampleSite/content/notes/boxplot.md')
-rw-r--r-- | exampleSite/content/notes/boxplot.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/exampleSite/content/notes/boxplot.md b/exampleSite/content/notes/boxplot.md new file mode 100644 index 0000000..3c59178 --- /dev/null +++ b/exampleSite/content/notes/boxplot.md @@ -0,0 +1,27 @@ +--- +title: "Box Plot" +date: 2019-06-28 +tags: ["Visualization"] +categories: ["R"] +description: "Drawing box plot in base R" +draft: false +--- + +# matrix +``` +mat <- cbind(Uni05 = (1:100)/21, Norm = rnorm(100), + `5T` = rt(100, df = 5), Gam2 = rgamma(100, shape = 2)) +boxplot(mat) # directly, calling boxplot.matrix() +``` + +# data.frame +``` +df. <- as.data.frame(mat) +par(las = 1) # all axis labels horizontal +boxplot(df., main = "boxplot(*, horizontal = TRUE)", horizontal = TRUE) +``` + +# formula +``` +boxplot(wt ~ cyl, mtcars) +```
\ No newline at end of file |