1/19
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
How do you distinguish between a negative number and subtracting when programming?
There is a space before the number when subtracting
How does R determine if one string is less than or greater than another string?
It looks at the first letter, and then compares them alphabetically. Later in the alphabet is greater in value. If the first letters are the same, the one with more letters is greater.
How do you type the “and” operator in R?
&
How do you type the “or” operator in R?
|
What is the result of this line of code:
c(TRUE, TRUE, FALSE) & c(TRUE, FALSE, FALSE)
TRUE FALSE FALSE
How do you flip the TRUEs and FALSEs of a boolean vector?
Put a ! before it
What are the differences between & and && as well as | and ||?
When you double the operator, it only returns the first result, it cannot return multiple results
Does R use elif or else if?
Else if
What is the difference between printing by using the print() function and by not using the function?
If you don’t use the function inside of a programming structure, the variable doesn’t print
What is peculiar about if else statements in R?
The else must be on the same line as the brace
How do you make the program get out of a while loop without meeting the condition?
break
What is the formula for the parentheses of a for loop?
for (x in series)
What is the keyword that skips ahead to the next loop of a for loop?
next
What is the function to get the length of a vector?
length
What are the functions to get the number of rows and columns in matrices/dataframes?
nrow() and ncol()
What function is used to combine strings in R?
paste()
How do vectors work with paste?
First the corresponding elements of each vector are combined, and then these pairs are combined
What are the arguments for paste, and how do they interact with vectors?
Sep and collapse. Sep is what goes in the middle of each pair. Collapse is what goes on the outside, between the pairs.
What does cat() do?
Prints a filtered version of the object
When do you use print and when do you use cat?
print: When you want to understand the variable
cat: When you want to communicate with the user