-
Notifications
You must be signed in to change notification settings - Fork 0
/
tibble_tribble.Rmd
53 lines (41 loc) · 959 Bytes
/
tibble_tribble.Rmd
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
title: "tribble"
author: "KevinO'Brien"
date: "22 September 2018"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tibble)
```
## ``tribble``: Row-wise tibble creation
#### Description
Create tibbles using an easier to read row-by-row layout. This is useful for small tables of data where readability is important. Please see tibble-package for a general introduction.
#### Usage
<pre><code>
tribble(...)
</code></pre>
#### Arguments
* ``...`` : Arguments specifying the structure of a tibble. Variable names should be formulas, and may only appear before the data.
Details
frame_data() is an older name for tribble(). It will eventually be phased out.
#### Value
A tibble.
#### Examples
```{r}
tribble(
~colA, ~colB,
"a", 1,
"b", 2,
"c", 3
)
```
```{r}
# tribble will create a list column if the value in any cell is
# not a scalar
tribble(
~x, ~y,
"a", 1:3,
"b", 4:6
)
```