Skip to content

Commit

Permalink
adding exercise solutions
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Caballero committed Apr 22, 2024
1 parent 80adc3c commit b57514c
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions qmd/08_DataWrangling.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ select(rna, gene, sample, tissue, expression)
## Dplyr in action - `select()` {auto-animate="true"}

Column exclusion can be defined with `-`
```{r}#| echo: true
```{r}
#| echo: true
select(rna, gene, -sample, -tissue, -time)
```


## Hands on {auto-animate="true"}
Expand All @@ -84,7 +88,7 @@ select(rna, gene, ensembl_gene_id, hsapiens_homolog_associated_gene_name)
- Select `gene, gene_biotype, phenotype_description`
```{r}
#| echo: true
select(rna, gene_biotype, phenotype_description)
select(rna, gene, gene_biotype, phenotype_description)
```

## Dplyr in action - `filter()` {auto-animate="true"}
Expand Down Expand Up @@ -124,6 +128,23 @@ filter(rna, sex == "Male", infection == "NonInfected")

- Filter data for `Cerebellum` in `time 0`

## Hands on {auto-animate="true"}

- Filter data for `females` and `infected`

```{r}
#| echo: true
filter(rna, sex == "Female", infection != "NonInfected")
```

## Hands on {auto-animate="true"}

- Filter data for `Cerebellum` in `time 0`
```{r}
#| echo: true
filter(rna, tissue == "Cerebellum", time == 0)
```

## Dplyr in action - `filter()` {auto-animate="true"}

Expand Down

0 comments on commit b57514c

Please sign in to comment.