ENVS 2100 - post midterm

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
GameKnowt Play
New
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

a collection of lines of code is called…

a script

2
New cards

why code? (3)

  • Handles large complex datasets better than many commercial software products (like Excel

  • Expands the suite of tools you can use to analyse and visualize data

  • Coders / programmers are in demand in the job market. Even if your career isn’t focused entirely on coding, there are many jobs which advertise coding experience as an asset

    or requirement.

3
New cards

why R? (4)

  • R is free and open source!

  • R provides a wide variety of statistical and graphical techniques.

  • R works on data of all shapes and sizes.

  • R produces high-quality graphics

  • R code (and coding in general) is great for reproducibility

4
New cards

what is the console called?

RGUI

5
New cards

Source Pane

Displays script. Type your code here. Click on Run to execute. Results appear below

6
New cards

Console Pane

Script output is shown here. You can also type code directly (press Return to execute)

7
New cards

Environment/History Pane

Script output is shown here. You can also type code directly (press Return to execute)

8
New cards

Files/Help/Plot Pane

exactly what it says. switch between tabsto access files, help, and plot visualizations.

9
New cards

Variables

used to store data

variablename < -

  • must start with a letter or period

  • cannot be a reserved word (e.g. TRUE, FALSE, NA)

10
New cards

Operators

arry out different mathematical and logical operations.

  • + – * / < > == !=

11
New cards

Functions

execute a specific task. Functions can be built-in, or users can make functions.

  • mean() median() sd() var()

  • can take multiple arguments within the brakets

12
New cards

Mathematical Operators

+

-

*

/

^ or **

13
New cards

Logical Operators

> greater than

>= greater or equal to

== equal to

!= not equal to

14
New cards

how to make a comment

“#” followed by intended comment

15
New cards

R data types

  • numeric

  • integer

  • double

  • character

  • logical

16
New cards

numeric data

numbers

17
New cards

integer data

numbers that do not contain decimal values

18
New cards

double data

numbers that contain decimal values

19
New cards

character data

string of keyboard characters (within quotations)

  • “hello2you” “3.4”

20
New cards

logical data

truth values

  • TRUE or FALSE

21
New cards

how to check the type of data?

use the function: typeof()

22
New cards

reserved words

TRUE = logical value

FALSE = logical value

NA = Not Available, represents a missing value

NaN = Not a number, 0/0

Inf = infinity, 1/0

23
New cards

where are variable stored?

environment

24
New cards

Unlike spreadsheet programs such as Excel, R does not prioritize showing you…

the entire dataset

25
New cards

R data steuctures

  • vector

  • matrix

  • list

  • dataframe

26
New cards

vector

Set of elements with the same data type

27
New cards

matrix

2D array of elements with the same data type

28
New cards

list

Set of elements with different data types

29
New cards

dataframe

2D array of elements with different data types

30
New cards

how are excel spreadsheets imported into R?

as dataframes

31
New cards

how to open the Help pane which provides more
information on the function and its arguments?

?functionaname

32
New cards

e.g. breakdown: typeof(x)

  • typeof = function

  • x = the only argument of the function and is any R object.

  • the function returns the data type of x