Welcome to mirror list, hosted at ThFree Co, Russian Federation.

boxplot.md « notes « content « exampleSite - github.com/darshanbaral/khata.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3c591788a8ed073fbb9f64b8cb0d6b2a6b44051b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)
```