dplyrThis short tutorial will allow you to explore dplyr functionality based on the previous lecture. Every question can be answered with a combination of %>% pipes. You should refrain from using temporary variables and statements outside of the range of the tidyverse.
Assign to the name judgments
glimpse() to identify columns and column types.The column for the group is condition.
Divide all entries in the REI questionnaire by 5, the maximal value.
The result should be a tibble containing the dilemma and the average such that the dilemma with the highest average in the first row.
The format in the input is the reference allele, the position and the variant, commonly called alternative allele. In T6G, T is the reference allele, 6 is the position (along the gene) and G is the variant allele.
variants <- tribble(
~sampleid, ~var1, ~var2, ~var3,
"S1", "A3T", "T5G", "T6G",
"S2", "A3G", "T5G", NA,
"S3", "A3T", "T6C", "G10C",
"S4", "A3T", "T6C", "G10C"
)
The table should look something like this.
| sampleid | 3 | 5 | 6 |
|---|---|---|---|
| S1 | T | G | G |
| S2 | G | G | NA |
Genetic variants are labeled acording to their effect on stability of the gene product.
The final output should be vector of sample ids.
variant_significance <- tribble(
~variant, ~significance,
"A3T", "unknown",
"A3G", "damaging",
"T5G", "benign",
"T6G", "damaging",
"T6C", "benign",
"G10C", "unknown"
)