Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

DSR301M EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS, Exams of Nursing

DSR301M EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS

Typology: Exams

2024/2025

Available from 11/08/2024

ExamTrust
ExamTrust 🇺🇸

3.6

(11)

3.4K documents

Partial preview of the text

Download DSR301M EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS and more Exams Nursing in PDF only on Docsity!

DSR301M EXAM 2024/2025 WITH 100% ACCURATE SOLUTIONS

Which of the following data type conversions may be not allowed in R? - Precise Answer ✔✔character (like 1, A, or test) to numeric What is the result of the R expression 100 * (5 - 3)? - Precise Answer ✔✔ 200 After you write code in an R script file or the R Console, what component of the R environment parses the code into objects in memory? - Precise Answer ✔✔R Interpreter Which features of RStudio help facilitate code writing? Select two answers. - Precise Answer ✔✔Syntax highlighting Code auto completion True or False: Execution order does not matter when executing cells in a Jupyter notebook - Precise Answer ✔✔False R can perform several forms of statistical computation. What is an example of hypothesis testing? - Precise Answer ✔✔Testing if the mean values of two groups are statistically different. What is a nominal factor? - Precise Answer ✔✔A factor with no implied order. Assume that the variable test_result contains the vector c(25, 35, 40, 50, 75).What is the result of the expression mean(test_result)? - Precise Answer ✔✔ 45 Assume you have variable called employee that contains the expression list(name = "Juan", age = 30). What is the correct command to change the contents of the age item to 35? - Precise Answer ✔✔employee["age"] <- 35 What is the main difference between a matrix and an array? - Precise Answer ✔✔A matrix must be two dimensional, but an array can be single, two dimensional, or more than two dimensional.

Assume that you have a data frame called employee that contains three variables: name, age, and title. If you want to return all the values in the title variable, what command should you use? - Precise Answer ✔✔employee$title What is the result of the conditional statement 25 > 15 | 99 >= 100? - Precise Answer ✔✔TRUE How do you define a global variable in a function? - Precise Answer ✔✔Use the <<- assignment operator. You can use the str_sub() function to form a substring by counting back from the last position. This function is part of which package? - Precise Answer ✔✔stringr Assume you have a data frame that contains a string variable called 'phone'. The phone numbers in this variable appear in (###) ###-#### or ###-###-#### format. Which feature of R can you use to isolate the area code (the three numbers between the parentheses or the first three numbers)? - Precise Answer ✔✔A regular expression. When you convert a date in string format to a Date object, what information do you need to pass to the as.Date() function? Select two answers. - Precise Answer ✔✔The string containing the date. The date format of the string. What is the difference between an error and a warning in you R code? - Precise Answer ✔✔An error halts code execution, while a warning does not. Assume you have read a .csv file into a data frame variable called employee. It has 20 rows of data and three variables: name, age, and title. What is the correct statement to use to return the fifth row of data in the name and title columns? - Precise Answer ✔✔employee[5, c("name", "title")] How do you return the number of characters in each paragraph of a text file that has been read into a character vector? - Precise Answer ✔✔Use the nchar() function. Which package do you need to install before writing to an Excel file in R? - Precise Answer ✔✔xlsx

You want to get a resource by its URL using an HTTP request and assign the HTTP response containing status code, headers, response body to a response variable. Which function should you use? - Precise Answer ✔✔response <- GET("https://www.mysite.com") After reading an HTML page from a URL, what must you do to get the node from the root node? - Precise Answer ✔✔Use the html_node() function to return the as a child node of node. Which of the following is a typical way that developers use the R language? - Precise Answer ✔✔Predictive analysis In R, what is the result of the function as.numeric(TRUE)? - Precise Answer ✔✔ 1 In R, which command removes a variable from memory? - Precise Answer ✔✔rm Which command in R would return the following character vector? "James" "Anna" "Lucas" "Harrold" - Precise Answer ✔✔c("James", "Anna", "Lucas", "Harrold") In R, assume you have a vector named "age," and each element in the vector is the age of one person in a group. The vector has the following content: 24 32 46 19. What will be the result if you issue the age[- 2] command? - Precise Answer ✔✔24 46 19 Assume the array books_array contains 6 elements. The array has three rows and two columns and appears as follows: [,1] [,2] [1,] "It" "Dr. Sleep" [2,] "Misery" "Carrie" [3,] "The Shining" "The Mist" If you input the books_array[,1] command, what will be the output? - Precise Answer ✔✔"It" "Misery" "The Shining" In R, which command should you use to insert a new row into a data frame? - Precise Answer ✔✔rbind Which of the following blocks of R code properly defines a function that takes two numbers as input and returns the product of the two numbers multiplied together? - Precise Answer ✔✔mult\ <- function(x,y) {x*y}

What is the first step you must take before you can read an Excel spreadsheet in R? - Precise Answer ✔✔Install the readxl library After installing and calling the httr library in R, which method should you use to send data to a server to create a resource? - Precise Answer ✔✔POST