R/iter.connection.R

iter.connection <- function(obj, ...) {
  s <- summary(obj)

  if (s$opened != "opened")
    stop("connection not opened")

  if (s$`can read` != "yes")
    stop("connection not readable")

  if (s$text == "binary")
    ireadBin(obj, ...)
  else
    ireadLines(obj, ...)
}

Try the itertools package in your browser

Any scripts or data that you put into this service are public.

itertools documentation built on May 2, 2019, 2:26 p.m.