# Data Science for Engineers | Week 1

Session: JUL-DEC 2024

Course name: Data Science for Engineers

#### These are Data Science for Engineers Week 1 Assignment Nptel Answers

Q1. Which of the following variable names are INVALID in R?
1_variable
variable_1
_variable
variable@

Q2.The function ls () in R will
set a new working directory path
list all objects in our working environment
display the path to our working directory
None of the above

Answer: list all objects in our working environment

These are Data Science for Engineers Week 1 Assignment Nptel Answers

Q3.Consider the following code snippet. Based on this, answer questions 3 and 4.
ID=c(1, 2, 3, 4)
Patient_name = c(“Ram”, “Shyam”, “Nandini”, “Maya”)
12345670
num.patient = 4
patient_list = list(num.patient, ID, Patient_name)

Which of the following command is used to access the value “Shyam”?
print(patient_list[3][2])
print(patient_list[[3]][1])
print(patient_list[[3]][2])
print(patient_list[[2]][2])

Q4.The output of the code given below is
for (i in patient_list[1]){
for (jin i){ print(j) }
}

These are Data Science for Engineers Week 1 Assignment Nptel Answers

Q5. What is the output of following code?
double
integer
list
None of the above

Q6. State whether the given statement is True or False.
The library reshape2 is based around two key functions named melt and cast.
True
False

These are Data Science for Engineers Week 1 Assignment Nptel Answers

Q7. What is the output of following code?
A = matrix(c(9:1), 3, 3)
print(A[3, 2])

6
4
2
8

Q8. Create the data frame using the code given below and answer questions 8 and 9.

Choose the correct command to add a column named student dept to the dataframe student data.
student_datastudent dept=c(“Commerce”, “Biology”, “English”, “Tamil”)
student_data[“student dept”]= c(“Commerce”,“Biology”, “English”,“Tamil”)
student_dept= student data[c(“Commerce”,“Biology”,“English”,“Tamil”)]
None of the above

These are Data Science for Engineers Week 1 Assignment Nptel Answers

Q9. Choose the correct command to access the element Tamil in the dataframe student_data.
student_data[[4]]
student_data[[4]][3]
student_data[[3]][4]
None of the above

Q10. The command to check if a value is of numeric data type is __.
typeof()
is.numeric()
as.numeric()
None of the above