Question: Problem 4 Consider the list car < - list ( model = c ( Ford , BMW ) , price =

Problem 4
Consider the list
car <- list(model = c("Ford","BMW"),
price = c(23000,30000),
color = c("Red", "Black"),
sold_last_week = list(ws_ford = c(1,3,4,4,5,6), ws_BMW = c(1,2,0,1,3,0)))
The code that will extract, in a vector of length 2, the number of BMW cars sold on the first and the third day of last week is
A. car[[4]][2][c(1,3)]
B. car[4][[2]][c(1,3)]
C. car[4][2][c(1,3)]
D. car[[4]][[2]][c(1,3)]
Answer:________
problem 5
Let x <- c(-2,3,-4,5,-6,7,8) is a vector. The result of executing the code x >0 is
A. TRUE FALSE TRUE FALSE TRUE FALSE FALSE
B. FALSE TRUE FALSE TRUE FALSE TRUE TRUE
C. FALSE TRUE FALSE TRUE FALSE TRUE FALSE
D. TRUE TRUE FALSE TRUE FALSE TRUE TRUE
Problem 6
Consider the function
f <- function(x =-10, y =5){
return(y^2- abs(x))
}
What is the value of f(3,)
A.1
B.22
C.-1
D.15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!