Configuration de l’environnement interactif R
Installer l’extension Quarto Live
quarto add r-wasm/quarto-liveConfiguration YAML pour R interactif
---
format: live-html
webr:
packages:
- dplyr
- ggplot2
---Tutoriel d’approfondissement: Installation de Quarto Live et WebAssembly
Scripts R interactifs de base
Exemple de bloc de code R:
```{webr}
# Script R interactif de base
x <- 1:10
mean(x)
```Résultats:
Tutoriel d’approfondissement: R interactif pour les débutants
Tracé interactif
ggplot2 Example
Code Source
```{webr}
library(ggplot2)
ggplot(mtcars, aes(x=wt, y=mpg)) + geom_point()
```Résultats
Plotly Exemple
Code Source
```{webr}
library(plotly)
plot_ly(data = iris, x = ~Sepal.Length, y = ~Petal.Length, type = 'scatter', mode = 'markers')
```Résultats
Tutoriel d’approfondissement: Visualisation interactive de données en R
Widgets interactifs et exercices
Création de widgets interactifs (htmlwidgets)
Code Source
```{webr}
library(DT)
DT::datatable(iris)
```Résultats
Exercice interactif avec conseils et solutions
Code Source
::: {.panel-tabset}
#### Exercice
```{webr}
#| exercise: ex_mean
# Calculez la moyenne du vecteur suivant
vec <- c(2, 4, 6, 8, 10)
mean(vec)
```
#### Indice
Utiliser la fonction `mean()`.
#### Solution
```r
mean(vec)
```
:::Utiliser la fonction mean().
mean(vec)Tutoriel d’approfondissement: Conception et notation d’exercices R interactifs
Plus d’informations
- Explication des blocs de code interactifs
- Gestion des environnements d’exécution
- Widgets interactifs en R
- Shinylive Essentials for R
Explorer d’autres articles
Voici d’autres articles de la même catégorie pour vous aider à approfondir le sujet.
Réutilisation
Citation
@online{kassambara2025,
author = {Kassambara, Alboukadel},
title = {Référence rapide R interactive - Fiche de contrôle},
date = {2025-03-22},
url = {https://www.datanovia.com/fr/learn/interactive/cheatsheets/interactive-r-quick-reference.html},
langid = {fr}
}
