Which of the following R code creates a connection to ‘foo.txt’?
(a) con <- file(“foo.txt”)
(b) open(con, “r”)
(c) opencon(con, “r”)
(d) ocon(con, “r”)
I have been asked this question in an interview for job.
This intriguing question originated from Connection Interfaces in portion R – Data Storage, Formats, Objects and Operations of R Programming