Intro to R Flashcards

1
Q

Differentiate between:
1) R Script
2) Environment
3) R Console
4) Directory

A

script: top left. write code.
environment: top right. lists objects created
r console: output
directory: bottom right. help and plot tabs and where files stored.

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

What 3 things will we do with R?

A

1) calculations
2) make objects
3) use functions that interact with data

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

How to make code easier to read?

A

add space between operations or objects

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

How to create an object.
What is object

A

<- or =

boxes that hold other things

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

Rules for the name of an object

A

Cannt begin with number, no spaces, no special characters $%

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

What does an R function do? 3things

A

Takes in one or more input
Performs one or more actions with the input
Produces one or more output

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

Syntax of functions.

A

functionname(argument1,2)

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

How to set working directory

A

Session, set wd, source file location

or setwd()

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

What are in quotes? What aren’t

A

Quotes is text.

Not quotes is function name, object, argument, or special value

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

Csv full name

A

Comma separated value files

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

How to read csv

A

read.csv(“name”)

save contents in an object

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

2 things can do to view dataset

A

Type object into console

View()

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

Vectors

A

Objects that hold multiple data values of a datatype

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

How to make vector

A

Name <- c(“”)

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

Why use statistics?

A

Human reason or common sense can be misleading or contradictory

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

How to stop running code

A

Esc