WEEK 2: Programming and using RStudio Flashcards

1
Q

Functions

A

begin with function names like print or paste, and are usually followed by one or more arguments in parentheses.

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

An argument

A

Is information that a function in R needs in order to run.

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

If you want to find out more about any function

A

All you have to do is type a question mark, the function name, and a set of parentheses.

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

A variable

A

Is a representation of a value in R that can be stored for use later during programming.
A variable name should start with a letter and can also contain numbers and underscores.
The name of the variable <- the value of variable
Ex: City <- 12 or “Mony”

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

Comments

A

Are helpful when you want to describe or explain what’s going on in your code.
Comments should be used to make an R script more readable.
How to comment in R: #text

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

A vector

A

Is a group of data elements of the same type stored in a sequence in R.
Vec <- c(x,y,z,…)

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

A pipe

A

Is a tool in R for expressing a sequence of multiple operations.
%>%

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

A data frame

A

Is a collection of columns–similar to a spreadsheet or SQL table.

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

A matrix

A

Is a two-dimensional collection of data elements. This means it has both rows and columns.

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

Packages in R include

A

Reusable R functions
Documentation about the functions, including how to use them.
Sample datasets
Tests for checking your code to make sure it does what you want it to do.

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

Conflicts happen when

A

Packages have functions with the same names as other functions.

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

Tydiverse packages

A

Ggplot2 is used for data visualization, specifically plots.
Tidyr is a package used for data cleaning to make tidy data.
Readr is used for importing data.
Dplyr offers a consistent set of functions that help you complete some common data manipulation tasks.

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

Factors

A

Store categorical data in R where the data values are limited and usually based on a finite group like country or year.

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