R codes Flashcards

1
Q

Code for a scatterplot

A

plot(VN, VN, xlab=”VN”, ylab=”VN”)

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

To add a line of best fit to scatterplot

A

Library(readx1)
abline(Lm(VN~VN), col = “red”)

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

code for Z-score

A

codename$codename<-scale(VN, center=TRUE, scale=TRUE)

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

Code to turn off scientific notion for really small p-values

A

options(scipen = 999)

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

regression / ANOVA table

A

Model1 <- Lm(VN~VN)
summary(Model1)

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

code for Pearsons

A

cor.test(VN, VN)

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

code for Spearman’s

A

cor.test(VN, method= “spearman”)

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