Skip to content

R Programming(Data Science Specialization)

Course Assignments

Week 1 Quiz:R Programming(Data Science Specialization):Answers2025

Q1 — R’s language origin 👉 R is a dialect of the S language developed at Bell Labs (not Lisp or Scheme).🧩 Concept: R inherited syntax & semantics from S; it’s not a Lisp dialect. Q2 — “Free software” freedoms The four freedoms (0–3) are:0️⃣ Run program for any purpose1️⃣ Study how it works, modify… <a href="https://codeshala.io/platform/coursera/course/r-programmingdata-science-specialization/assignment/week-1-quizr-programmingdata-science-specializationanswers2025/" rel="bookmark"><span class="screen-reader-text">Week 1 Quiz:R Programming(Data Science Specialization):Answers2025</span></a>

Week 2 Quiz:R Programming(Data Science Specialization):Answers2025

Question 1 Suppose I define the following function: cube <- function(x, n) { x^3 } cube(3) ✅ The number 27 is returned❌ An error is returned because ‘n’ is not specified❌ The user is prompted to specify ‘n’❌ A warning is given Explanation:The function ignores n. It simply computes x^3, so cube(3) → 3³ =… <a href="https://codeshala.io/platform/coursera/course/r-programmingdata-science-specialization/assignment/week-2-quizr-programmingdata-science-specializationanswers2025/" rel="bookmark"><span class="screen-reader-text">Week 2 Quiz:R Programming(Data Science Specialization):Answers2025</span></a>

Programming Assignment 1: Quiz:R Programming(Data Science Specialization):Answers2025

Question 1 pollutantmean("specdata", "sulfate", 1:10) ✅ 4.064❌ 6.026❌ 3.782❌ 3.666❌ 4.868❌ 6.545 Explanation:The function computes the mean of all valid sulfate observations across monitors 1–10. After excluding NAs, the rounded mean = 4.064. Question 2 pollutantmean("specdata", "nitrate", 70:72) ✅ 1.706❌ 2.604❌ 1.182❌ 0.914❌ 2.394❌ 2.752 Explanation:Average nitrate levels among monitors 70–72 (after removing missing values)… <a href="https://codeshala.io/platform/coursera/course/r-programmingdata-science-specialization/assignment/programming-assignment-1-quizr-programmingdata-science-specializationanswers2025/" rel="bookmark"><span class="screen-reader-text">Programming Assignment 1: Quiz:R Programming(Data Science Specialization):Answers2025</span></a>

Week 3 Quiz:R Programming(Data Science Specialization):Answers2025

Question 1 Mean of Sepal.Length for species virginica (rounded to nearest whole number) ✅ 7 Explanation: library(datasets) data(iris) mean(iris$Sepal.Length[iris$Species == "virginica"]) = 6.588, which rounds to 7. Question 2 Which R code returns a vector of means for the variables Sepal.Length, Sepal.Width, Petal.Length, and Petal.Width? ✅ apply(iris[, 1:4], 2, mean)❌ rowMeans(iris[, 1:4])❌ apply(iris, 2, mean)❌… <a href="https://codeshala.io/platform/coursera/course/r-programmingdata-science-specialization/assignment/week-3-quizr-programmingdata-science-specializationanswers2025/" rel="bookmark"><span class="screen-reader-text">Week 3 Quiz:R Programming(Data Science Specialization):Answers2025</span></a>

Week 4 Quiz:R Programming(Data Science Specialization):Answers2025

Question 1What is produced at the end of this snippet of R code?set.seed(1)rpois(5, 2) ✅ A vector with the numbers 1, 1, 2, 4, 1❌ It is impossible to tell because the result is random❌ A vector with the numbers 3.3, 2.5, 0.5, 1.1, 1.7❌ A vector with the numbers 1, 4, 1, 1, 5… <a href="https://codeshala.io/platform/coursera/course/r-programmingdata-science-specialization/assignment/r-programmingdata-science-specializationanswers2025/" rel="bookmark"><span class="screen-reader-text">Week 4 Quiz:R Programming(Data Science Specialization):Answers2025</span></a>

Programming Assignment 3: Quiz:R Programming(Data Science Specialization):Answers2025

Question 1 best("SC", "heart attack") ✅ MUSC MEDICAL CENTER❌ CAROLINAS HOSPITAL SYSTEM❌ MARY BLACK MEMORIAL HOSPITAL❌ GRAND STRAND REG MED CENTER❌ LAKE CITY COMMUNITY HOSPITAL❌ MCLEOD MEDICAL CENTER – DARLINGTON Explanation:For South Carolina (“SC”), MUSC Medical Center has the lowest (best) 30-day mortality rate for heart attacks. Question 2 best("NY", "pneumonia") ✅ MAIMONIDES MEDICAL CENTER❌… <a href="https://codeshala.io/platform/coursera/course/r-programmingdata-science-specialization/assignment/programming-assignment-3-quizr-programmingdata-science-specializationanswers2025/" rel="bookmark"><span class="screen-reader-text">Programming Assignment 3: Quiz:R Programming(Data Science Specialization):Answers2025</span></a>