Vuelve A Intentarlo Cuando Estés Listo.: Week 3 Quiz
Vuelve A Intentarlo Cuando Estés Listo.: Week 3 Quiz
0/1
puntos
1.
Take a look at the 'iris' dataset that comes with R. The data can be loaded with the code:
1 library(datasets)
2 data(iris)
1 ?iris
There will be an object called 'iris' in your workspace. In this dataset, what is the mean of
'Sepal.Length' for the species virginica? Please round your answer to the nearest
whole number.
6.588
Respuesta incorrecta
0/1
puntos
2.
Continuing with the 'iris' dataset from the previous Question, what R code returns a
vector of the means of the variables 'Sepal.Length', 'Sepal.Width', 'Petal.Length', and
'Petal.Width'?
apply(iris, 2, mean)
colMeans(iris)
https://www.coursera.org/learn/r-programming/exam/hZgBh/week-3-quiz 1/4
3/11/2017 Coursera | Online Courses From Top Universities. Join for Free | Coursera
Week 3 Quiz this takes the row means of the dataset. 1/5 points (20 %)
Cuestionario, 5 questions
rowMeans(iris[, 1:4])
apply(iris, 1, mean)
0/1
puntos
3.
Load the 'mtcars' dataset in R with the following code
1 library(datasets)
2 data(mtcars)
There will be an object names 'mtcars' in your workspace. You can nd some
information about the dataset by running
1 ?mtcars
How can one calculate the average miles per gallon (mpg) by number of cylinders in the
car (cyl)? Select all that apply.
apply(mtcars, 2, mean)
Deseleccionado es lo correcto
Correcto
Deseleccionado es lo correcto
mean(mtcars$mpg, mtcars$cyl)
Deseleccionado es lo correcto
https://www.coursera.org/learn/r-programming/exam/hZgBh/week-3-quiz 2/4
3/11/2017 Coursera | Online Courses From Top Universities. Join for Free | Coursera
lapply(mtcars, mean)
Deseleccionado es lo correcto
split(mtcars, mtcars$cyl)
Deseleccionado es lo correcto
0/1
puntos
4.
Continuing with the 'mtcars' dataset from the previous Question, what is the absolute
di erence between the average horsepower of 4-cylinder cars and the average
horsepower of 8-cylinder cars?
(Please round your nal answer to the nearest whole number. Only enter the
numeric result and nothing else.)
126.5779
Respuesta incorrecta
1/1
puntos
5.
If you run
1 debug(ls)
Execution of the 'ls' function will suspend at the 4th line of the function and
you will be in the browser.
https://www.coursera.org/learn/r-programming/exam/hZgBh/week-3-quiz 3/4
3/11/2017 Coursera | Online Courses From Top Universities. Join for Free | Coursera
You will be prompted to specify at which line of the function you would like to
suspend execution and enter the browser.
Week 3 Quiz 1/5 points (20 %)
Cuestionario, 5 questions Execution of 'ls' will suspend at the beginning of the function and you will be in
the browser.
Correcto
https://www.coursera.org/learn/r-programming/exam/hZgBh/week-3-quiz 4/4