W2: Intro to R and RStudio Flashcards
< OR %1%
Less than
<= OR %le%
less than or equal
%gl%
greater than AND less than
%gel%
greater than or equal AND less than
%gle%
greater than AND less than or equal
%gele%
greater than or equal AND less than or equal
%!in% OR %nin%
not in
.N
all sample size
d[UserID ! = 56 & NA <= 4]
Exclude ID 56, select observation with NA at or below 4
What are the 4 data types using class()?
Logical, integer, numeric, character
What is logical data?
True (1) or False (0)
What is integer type data?
Whole numbers (pos / neg) e.g -1,0,1,2
What is numeric type data?
Real numbers (whole, decimals, fractions)
What is character data?
Text data, including numbers stored as strings
What does this represent D [ i, j, by] ?
i = rows, j = columns, by = grouping variable
%Y - %m - %d
4 digit 2019 - 03 - 12
%d / %m / %y
12 / 03 / 19 (2 digit)
%Y - %b - %d
2019 - Mar - 12
What does using factor() need?
levels = c(1, 0, 2) and
labels = c(“dog”, “cat”, rabbit”)
Name the join and argument used for:
Data with only rows present in both x and y
Natural Join, all = FALSE
Name the join and argument used for:
Data with all rows in x and y
Full Outer Join, all = TRUE
Name the join and argument used for:
Data with all rows in x
Left Outer Join, all.x = TRUE
Name the join and argument used for:
Data with all rows in y
Right Outer Join, all.y = TRUE
Which join / merge will have most rows?
Full Outer Join