Removing useless tables
This commit is contained in:
parent
6b65a2723e
commit
8ffa0f5614
2 changed files with 3 additions and 37 deletions
|
|
@ -6,7 +6,9 @@ execute:
|
|||
warning: false
|
||||
fig-width: 10
|
||||
fig-height: 10
|
||||
format: html
|
||||
format:
|
||||
html:
|
||||
embed-resources: true
|
||||
---
|
||||
|
||||
## Description des données
|
||||
|
|
@ -134,27 +136,6 @@ htmltools::tagList(lapply(vec_sequences, function(sequence) {
|
|||
}))
|
||||
```
|
||||
|
||||
### Tableaux
|
||||
|
||||
```{r}
|
||||
#| tbl-cap: !expr 'paste("Table des proportions de choix par cluster pour ",(colnames(data)[3:ncol(data)-1]))'
|
||||
#| result: asis
|
||||
ac <- NULL
|
||||
vec_sequences <- (colnames(data)[3:ncol(data) - 1])
|
||||
for (sequence in vec_sequences) {
|
||||
ac <- as.data.frame(table(data[["cluster"]], data[[sequence]], useNA = "ifany"))
|
||||
colnames(ac) <- c("cluster", "uc", "nb")
|
||||
ac <- ac %>%
|
||||
group_by(cluster) %>%
|
||||
mutate(Prop = nb / sum(nb), uc = str_wrap(uc, 30))
|
||||
ac_table <- ac %>%
|
||||
select(-nb) %>%
|
||||
pivot_wider(names_from = uc, values_from = Prop)
|
||||
print(ac_table %>% datatable(filter = "top"))
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
:::
|
||||
|
||||
|
|
|
|||
15
tabset.qmd
15
tabset.qmd
|
|
@ -43,18 +43,3 @@ htmltools::tagList(lapply(vec_sequences, function (sequence) {
|
|||
p
|
||||
}))
|
||||
```
|
||||
|
||||
#### Tables
|
||||
```{r}
|
||||
#| tbl-cap: !expr 'paste("Table des proportions de choix par cluster pour ",(colnames(data)[3:ncol(data)-1]))'
|
||||
#| result: asis
|
||||
ac <- NULL
|
||||
vec_sequences <- (colnames(data_domi)[4:ncol(data_domi)-1])
|
||||
for(sequence in vec_sequences) {
|
||||
ac <- as.data.frame(table(data_domi[["cluster"]], data_domi[[sequence]], useNA = "ifany"))
|
||||
colnames(ac) <- c("cluster", "uc", "nb")
|
||||
ac <- ac %>% group_by(cluster) %>% mutate(Prop = nb/sum(nb), uc = str_wrap(uc,30))
|
||||
ac_table <- ac %>% select(-nb) %>% pivot_wider(names_from = uc, values_from = Prop)
|
||||
print(ac_table %>% datatable(filter = "top") %>% formatRound(columns = - 1, digits = 3))
|
||||
}
|
||||
```
|
||||
Loading…
Add table
Reference in a new issue