Intermediate R - Part 1

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:28 PM on 2/7/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

20 Terms

1
New cards

How do you distinguish between a negative number and subtracting when programming?

There is a space before the number when subtracting

2
New cards

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.

3
New cards

How do you type the “and” operator in R?

&

4
New cards

How do you type the “or” operator in R?

|

5
New cards

What is the result of this line of code:

c(TRUE, TRUE, FALSE) & c(TRUE, FALSE, FALSE)

TRUE FALSE FALSE

6
New cards

How do you flip the TRUEs and FALSEs of a boolean vector?

Put a ! before it

7
New cards

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

8
New cards

Does R use elif or else if?

Else if

9
New cards

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

10
New cards

What is peculiar about if else statements in R?

The else must be on the same line as the brace

11
New cards

How do you make the program get out of a while loop without meeting the condition?

break

12
New cards

What is the formula for the parentheses of a for loop?

for (x in series)

13
New cards

What is the keyword that skips ahead to the next loop of a for loop?

next

14
New cards

What is the function to get the length of a vector?

length

15
New cards

What are the functions to get the number of rows and columns in matrices/dataframes?

nrow() and ncol()

16
New cards

What function is used to combine strings in R?

paste()

17
New cards

How do vectors work with paste?

First the corresponding elements of each vector are combined, and then these pairs are combined

18
New cards

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.

19
New cards

What does cat() do?

Prints a filtered version of the object

20
New cards

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