R studio Flashcards

1
Q

str()

A

way of summarizing the data

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

count()

A

counts variables

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

group_by()

A
  • groups a dataset
  • whatever you do next to the dataset will be done separately for each group
  • e.g. each gender
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

summarise ()

A

will create a table with summary stats you have requested

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

inner_join()

A

Uses matching rows from each data set to join them
e.g.
full_dat <- inner_join(x = demographic_data,
y = score_data,
by = “Participant”)

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

select ()

A

Creates a new dataset with just the columns you want
If you want to say which ones you don’t want use -variable.

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

filter ()

A

Used to pick which rows of data you want to keep based on one or more criteria

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

mutate()

A

Changing the data set
For example adding a new variable:
full_data <- full_data %>%
mutate(gender_coded = factor(gender,
levels = c(2,1, 3),
labels = c(“Man”, “Woman”, “Nonbinary”)))

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

How do you create a scatter plot

A

ggplot( data set, aes(x = variable, y = variable)) + geom_point()

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

How do you add a line of best fit to a scatter graph?

A

geom_(smooth)

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

pivot_longer()

A

transforms data from wide-form to long-form

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

How do you use pivot_longer?

A

pivot_longer (cols = first column : last column,
names to = “coloumn name”,
values to = “column name”

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

as.factor()

A

Overwrites whatever is in that column as a factor

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

as.character()

A

overwrites whatever is in that column as a character

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