Semaine 5 Flashcards

1
Q

Nommez quelques fonctions qui permette d’ajouter des éléments dans un graphique :

A

abline , points , lines , segments , polygon , arrows ,

legend, text, mtext, title, axis, box

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Que fait la fonction abline ?

A

Elle permet d’ajouter une droite à un graphique

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Supposons que je veuille ajouter un incertitude sur une donnée de mon graphique, quelle fonction puis-je utiliser?

A

La fonction “lines”.

plot(x, y, pch = 2)
abline(lmout)
lines(c(1.5, 2.5), c(3,3), lty = 2, col = 2)

où “lty”est la fréquence des pointillés et “col” est la couleur.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Je veux relier les points de mon graphique, avec quelle argument supplémentaire de la fonction “plot” puis-je facilement le faire?

A

plot(x, y, type = “b”)

——–> On voit que ce n’est pas très intuitif.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Si je veux relier les points sans symbole, quelle argument ?

A

plot(x, y, type = “l”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Afin de rétablir l’apparence des graphiques par défaut, j’utilise la fonction :

A

par()

par.default

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Supposons que je veuille empêcher R de faire un nouveau graphique ..

A

par( new = T )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Je veux ajouter des points dans un graphique, quelle méthode ?

A

points(c(-1,0,1) ,c(0,1,2), pch = 3)

où pch désigne l’apparence des points.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Je veux enregistrer un graphiqe dans une fenêtre! Comment puis-je procéder afin de réussir l’exploit?

A

png(“test.png”)
plot(x, y, type = “b”)
dev.off()

Le fichier sera donc conservé dans le dossier contenant le projet R.
La fonction dev.off() met un terme entre R et le fichier ouvert.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Pour avoir plus d’information sur les annotations mathématiques ?

A

help(plotmath)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Comment s’appelle la fonction qui sépare un graphique en plusieurs fenêtres ?

A

par(mfrow = c(1,3), oma = c(0, 0, 3, 0))
curve(dnorm, -3, 3, main = “fonction de densité”)
curve(pnorm, -3, 3, main = “fonction de répartition”)
curve(qnorm, 0, 1, main = “fonction quantile”)
mtext(“Distribution normale standard”, side = 3, outer = TRUE)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly