Google News
logo
R - Quiz(MCQ)
Which of the following code opens a connection to the file foo.txt, reads from it, and closes the connection when its done?
A)
data <- read.csvo(“foo.txt”)
B)
data <- read.csv(“foo.txt”)
C)
data <- getonly.csv(“foo.txt”)
D)
data <- readonly.csv(“foo.txt”)

Correct Answer :   data <- read.csv(“foo.txt”)


Explanation : Connections must be opened, then the are read from or written to, and then they are closed.

Advertisement