R Code Basics Flashcards

1
Q

Help() or ?

A

Provides help documentation for a function or topic.

help(“tidyverse”)
?mean

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

data()

A

Loads built-in datasets.
data(trees)

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

str()

A

displays the structure of an R object.

str(trees)

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

head()

A

shows initial rows of data
head(trees)

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

summary()

A

Generates summary statistics
summary(trees)

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

cor()

A

computes correlation coeffcients

cor(trees)

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

hist()

A

plots histograms
hist(trees$Height)

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

plots()

A

Creates various types of plots
plots(trees)

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

lm()

A

Fits a linear regression model.
im(Volume ~ Height, data = trees)

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

c()

A

Combines arguments into a vector.

c(1, 8, 2024, 12, 15)
c(“Maple”, “Oak”, “Pine”)

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