inst/Examples/fieldsToLines.R

fieldsToLines <- function(input, nfield, sep = "",
                          outputSep = if(nchar(sep)) sep else " ",
                            addQuotes = FALSE, ...)
  {
    text <- scan(input, what = "", sep = sep, ...)
    if(addQuotes)
      text <- shQuote(text)
    text <- matrix(text, nrow = nfield)
    output <- apply(text, 2, paste, collapse = outputSep)
    textConnection(output)
  }

Try the SoDA package in your browser

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

SoDA documentation built on Oct. 28, 2020, 9:07 a.m.