Summary: Inf-22803
- This + 400k other summaries
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding
Read the summary and the most important questions on INF-22803
-
quiz 1
This is a preview. There are 1 more flashcards available for chapter 16/02/2020
Show more cards here -
What’s an object in R?
A name thatyou can use to call up stored data. -
What is the result if running the following code in the R studio console?my_num <- 1:6my_num
1 2 3 4 5 6 -
A function in R has three basic parts. Which of the following choices is NOT one of them?
Function -
Suppose you define a function with arguments, such as:roll <- function(bones) {x=bones}This function will give an error if you call it without a value for the argument bones.How can you prevent this error, even when you forget giving the argument a value?
Give the argument a default value -
In R programming, you need to use a file to save R code in. What is this file called?
Script -
Suppose we have a function: roll <- function(bones = 1:3) { dice <- sample(bones, size = 2, replace = TRUE) result <- sum(dice)}What is the range of all the possible values of ‘result’ after running this code?
[2,6] -
There are many design tools in R that can help people analyze data. You could directly call the functions after importing these tools. What are such tools called?
Package -
Suppose we have a function as follows:work <- function(x) { all<- sample(x, size = 2, replace = TRUE) sum(all)}We need to call this function. Which of the following code will NOT work?work(1)work(1:10)work()work(x=1:10)
work () -
What will happen if we write and run the following code in the R console? ?sample
Some help information is shown -
What will happen after running the following code:install.packages("ggplot2")
Install a library called ggplot2 in the platform
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding