Basic R Notation/Functions Flashcards

1
Q

<-

A

assignment like = in python
x assigned 10 (x <- 10)

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

~

A

operator to separate left and right sides of equation

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

#

A

used to comment out things

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

attach()

A

attaches data frame to a search path

makes it to where you don’t have to state path with a variable, can just say variable name

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

boxplot()

A

creates box and whisker plots

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

c()

A

combines values into a vector

c(“app”, “ban”, “ora”)

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

cor()

A

computes correlation coefficient between 2 variables

cor(x, y)

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

dir()

A

lists all of the files in a directory

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

head()

A

shows first few rows of a data frame

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

hist()

A

creates a histogram

hist(data, main =, xlab =)

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

ls()

A

lists the names of objects in the environment

if you’ve created x, y, and z variables, it will list those out

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

names()

A

outputs field headers in a table

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

plot()

A

could create scatter, line, or histogram

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

rm(list=ls())

A

deletes all objects in the current workspace like variables, functions, or objects

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

summary()

A

basic descriptive stats

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