ggtitle("Advanced Pairs Plot of Selected Variables")
advanced_plot
legend.position = "bottom")
```
4. Frequency Distributions of Categorical Variables (Tabset)
The following section uses R Markdown tabsets to display the frequency histograms of each categorical variable in separate tabs.
This helps in quickly verifying that each level of a variable is represented by a similar number of samples—a key point for balanced downstream analyses.
## Group Balance Check
<!-- To enable tabbed sections, add {.tabset} to the header -->
Frequency Distributions for Categorical Variables {.tabset}
condition
Vérifier la répartition des échantillons par condition
```{r}
ggplot(annotations, aes(x = condition)) +
geom_bar(fill = "blue", alpha = 0.7) +
labs(title = "Frequency Distribution: condition",
x = "Condition", y = "Count") +
theme_minimal()
condition_counts <- annotations %>%
count(condition) %>%
arrange(desc(n))
print(condition_counts)
```
sample
Vérifier la répartition des échantillons par animal
```{r}
ggplot(annotations, aes(x = sample)) +
geom_bar(fill = "steelblue", alpha = 0.7) +
labs(title = "Frequency Distribution: sample",
x = "Sample ID", y = "Count") +
theme_minimal()
animal_counts <- annotations %>%
count(animal) %>%
arrange(desc(n))
print(animal_counts)
```
animal
Bar plot interactif pour la répartition par animal