See streamParser
This function implementation uses function seek.
Documentation about this function states:
"
Use of 'seek' on Windows is discouraged. We have found so many
errors in the Windows implementation of file positioning that
users are advised to use it only at their own risk, and asked not
to waste the R developers' time with bug reports on Windows'
deficiencies.
"
If "fileName" is a url, seek is not possible.
In order to cover these situations, streamPaserFromFileName functions are converted in:
streamParserFromString(readLines( fileName, encoding=encoding))
Alternatively, it can be used:
streamParserFromString
with:
streamParserFromString(readLines(fileName))
or
streamParserFromString(
iconv(readLines(fileName), encodingOrigen,encodingDestino)
)
Since streamParserFromFileName also uses readChar
, this last option is the one advised in Linux if encoding is different from Latin-1 or UTF-8. As documentation states, readChar
may generate problems if file is in a multi-byte non UTF-8 encoding:
"
'nchars' will be interpreted in bytes not characters in a
non-UTF-8 multi-byte locale, with a warning.
"