obj[[1]]
[1] 3 5 1
[[2]]
[1] "a"
Examine this object:
obj?
---
title: "Data Structures: Exercises"
aliases: [../data_structures/data_structures_exercise.html]
---
## Data structures
Examine this object:
```{r, echo = FALSE}
obj <- list(c(3, 5, 1), "a")
```
```{r}
obj
```
1. What kind of data structure is `obj`?
- [ ] Data frame
- [ ] Vector
- [ ] List
- [ ] Matrix
::: {.callout-caution collapse="true"}
## Solution
- [ ] Data frame
- [ ] Vector
- [x] List
- [ ] Matrix
:::
2. And what types of vectors are included?
- [ ] Numeric and character.
- [ ] Character and logical.
- [ ] Only numeric.
- [ ] Only character.
::: {.callout-caution collapse="true"}
## Solution
- [x] Numeric and character.
- [ ] Character and logical.
- [ ] Only numeric.
- [ ] Only character.
:::