JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
R interview questions part 37
R interview questions part 37
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which of the following code extracts 1st element of the 2nd element ? > x <- list(a = list(10, 12, 14), b = c(3.14, 2.81))
A. x[[c(2, 1)]].
B. x[[c(1, 2)]].
C. x[[c(2, 1,1)]].
D. All of the mentioned
Show Correct Answer
Correct Answer is :
x[[c(2, 1)]].
2. What would be the output of the following code ? > x <- list(aardvark = 1:5) > x[["a", exact = FALSE]]
A. 1 2 3 4 5
B. 38386
C. 1 3 3 5
D. 37623
Show Correct Answer
Correct Answer is :
1 2 3 4 5
3. .What would be the output of the following code ? > x <- c(1, 2, NA, 4, NA, 5) > bad <- is.na(x) > print(bad)
A. FALSE FALSE FALSE FALSE TRUE FALSE
B. FALSE TRUE TRUE FALSE TRUE FALSE
C. FALSE FALSE TRUE FALSE TRUE FALSE
D. None of the mentioned
Show Correct Answer
Correct Answer is :
FALSE FALSE TRUE FALSE TRUE FALSE
4. Which of the following is used for reading in saved workspaces ?
A. unserialize
B. load
C. get
D. none of the mentioned
Show Correct Answer
Correct Answer is :
load
5. Point out the wrong statement :
A. write.table is used for for writing tabular data to text files (i.e. CSV) or connections
B. writeLines is used for for writing character data line-by-line to a file or connection
C. dump is used for for dumping a textual representation of multiple R objects
D. all of the mentioned
Show Correct Answer
Correct Answer is :
all of the mentioned
6. ________ is used for outputting a textual representation of an R object
A. dput
B. dump
C. dget
D. all of the mentioned
Show Correct Answer
Correct Answer is :
dput
7. Which of the following argument denotes if the file has a header line ?
A. header
B. sep
C. file
D. all of the mentioned
Show Correct Answer
Correct Answer is :
header
8. Point out the correct statement :
A. unserialize is used for converting an R object into a binary format for outputting to a connection
B. save is used for saving an arbitrary number of R objects in binary format to a file
C. The read.data() function is one of the most commonly used functions for reading data
D. all of the mentioned
Show Correct Answer
Correct Answer is :
save is used for saving an arbitrary number of R objects in binary format to a file
9. Which of the following statement would read file “foo.txt” ?
A. data <- read.table(“foo.txt”)
B. read.data <- read.table(“foo.txt”)
C. data <- read.data(“foo.txt”)
D. none of the mentioned
Show Correct Answer
Correct Answer is :
data <- read.table(“foo.txt”)
10. Which of the following function is identical to read.table ?
A. read.csv
B. read.data
C. read.tab
D. None of the mentioned
Show Correct Answer
Correct Answer is :
read.csv
11. Which of the following code would read 100 rows ?
A. initial <- read.table(“datatable.txt”, nrows = 100)
B. tabAll <- read.table(“datatable.txt”, colClasses = classes)
C. initial <- read.table(“datatable.txt”, nrows = 99)
D. all of the mentioned
Show Correct Answer
Correct Answer is :
initial <- read.table(“datatable.txt”, nrows = 100)
12. Unlike writing out a table or CSV file, dump() and dput() preserve the ______ so that another user doesn’t have to specify the all over again.
A. metadata
B. backup data
C. attribute data
D. normal data
Show Correct Answer
Correct Answer is :
metadata
13. One way to pass data around is by de parsing the R object with _________
A. dput()
B. write()
C. read()
D. dget()
Show Correct Answer
Correct Answer is :
dput()
14. Main way to read the data back in (parsing it) using the function.
A. dput()
B. write()
C. read()
D. dget()
Show Correct Answer
Correct Answer is :
dget()
15. dput() output is in the form of ___________
A. R code
B. text file code
C. binary code
D. both binary and text
Show Correct Answer
Correct Answer is :
R code
16. Multiple objects can be de parsed at once using the ______ function.
A. dput()
B. write()
C. dump()
D. dget()
Show Correct Answer
Correct Answer is :
dput()
17. Multiple objects can be de parsed at once and read back using function _____
A. source()
B. read()
C. dget()
D. dput()
Show Correct Answer
Correct Answer is :
source()
18. We can dump() R objects to a file by passing _____
A. character vector of their names
B. object name
C. arguments
D. file name
Show Correct Answer
Correct Answer is :
character vector of their names
19. If we want to save individual R objects to a file, we use the _______ function.
A. save()
B. save.image()
C. serialize()
D. deserialize()
Show Correct Answer
Correct Answer is :
save()
20. If you have a lot of objects that you want to save to a file, we use ________ function.
A. save()
B. save.image()
C. serialize()
D. deserialize()
Show Correct Answer
Correct Answer is :
save.image()
Similar Interview Questions
Search for latest jobs
Find Jobs