Weeks 1-5 RStudio Commands Flashcards

1
Q

To calculate the mean…

A

mean(sample_data)

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

To calculate the median…

A

median(sample_data)

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

To calculate the mode…

A

mode(sample_data)

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

To calculate standard deviation…

A

sd(sample_data)

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

Undo button

A

Ctrl + z

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

library(tidyverse)

A

Gives us useful tools for our analysis

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

cows <-read_csv(“~/penelope22.csv”)

A

Read spreadsheet called ‘penelope22’ into an object in R called ‘cows’ (basically renames spreadsheet for easy ref. later)

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

View(data)

A

Presents the data in a window in RStudio

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

What is a data frame?

A

2-dimmensional array of scores

Multiple columns in data set

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

When using a data frame, how do we specify which column we want to process?

State the code

A

(data$column)

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

How do we find the mean of a particular column in the data set?

data set name = cows
column name = estimate

A

mean(cows$estimate)

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

Tells Rstudio that missing data can be ignored…

A

na.rm = TRUE

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

Sometimes the data set can have missing values from the table.

How do we tell Rstudio to find the mean for a particular column that has missing values?

(data set name = cows)
(column = estimate)

A

mean(cows$estimate, na.rm = TRUE)

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

To create a histogram…

(data set name =sample_data)

A

hist(sample_data)

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

To create a histogram distribution for a particular column in the data set…

data set name = cows
column name = estimate

A

hist(cows$estimate)

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

To create a box plot…

data set name = sample_data

A

boxplot(sample_data)

17
Q

To create a boxplot for specific columns in data set…

data set name = screentime
column 1 name = usage
column 2 = phone_type

A

boxplot(screentime$usage ~ screentime$phone_type)