readBin | R Documentation |
These methods mask the identical functions in the base
package (see base::readBin()
,
base::readLines()
, base::readChar()
, base::writeBin()
, base::writeLines()
and
base::writeChar()
. They behave exactly the
same as their base counterpart, with the exception that they can read and write to connections
opened with adf_file_con()
.
readBin(
con,
what,
n = 1L,
size = NA_integer_,
signed = TRUE,
endian = .Platform$endian
)
## Default S3 method:
readBin(
con,
what,
n = 1L,
size = NA_integer_,
signed = TRUE,
endian = .Platform$endian
)
## S3 method for class 'adf_file_con'
readBin(
con,
what,
n = 1L,
size = NA_integer_,
signed = TRUE,
endian = .Platform$endian
)
readLines(
con,
n = -1L,
ok = TRUE,
warn = TRUE,
encoding = "unknown",
skipNul = FALSE
)
## Default S3 method:
readLines(
con = stdin(),
n = -1L,
ok = TRUE,
warn = TRUE,
encoding = "unknown",
skipNul = FALSE
)
## S3 method for class 'adf_file_con'
readLines(
con,
n = -1L,
ok = TRUE,
warn = TRUE,
encoding = "unknown",
skipNul = FALSE
)
writeBin(
object,
con,
size = NA_integer_,
endian = .Platform$endian,
useBytes = FALSE
)
## Default S3 method:
writeBin(
object,
con,
size = NA_integer_,
endian = .Platform$endian,
useBytes = FALSE
)
## S3 method for class 'adf_file_con'
writeBin(
object,
con,
size = NA_integer_,
endian = .Platform$endian,
useBytes = FALSE
)
writeLines(text, con, sep = "\n", useBytes = FALSE)
## Default S3 method:
writeLines(text, con = stdout(), sep = "\n", useBytes = FALSE)
## S3 method for class 'adf_file_con'
writeLines(text, con = stdout(), sep = "\n", useBytes = FALSE)
con |
A connection to a file on a virtual ADF device. Such a connection can
be established with |
what |
Either an object whose mode will give the mode of the
vector to be read, or a character vector of length one describing
the mode: one of |
n |
numeric. The (maximal) number of records to be
read. You can use an over-estimate here, but not too large as
storage is reserved for |
size |
integer. The number of bytes per element in the byte
stream. The default, |
signed |
logical. Only used for integers of sizes 1 and 2, when it determines if the quantity on file should be regarded as a signed or unsigned integer. |
endian |
The endian-ness ( |
ok |
logical. Is it OK to reach the end of the connection before
|
warn |
logical. Warn if a text file is missing a final EOL or if there are embedded nuls in the file. |
encoding |
encoding to be assumed for input strings. It is
used to mark character strings as known to be in
Latin-1, UTF-8 or to be bytes: it is not used to re-encode the input.
To do the
latter, specify the encoding as part of the connection |
skipNul |
logical: should nuls be skipped? |
object |
An R object to be written to the connection. |
useBytes |
See |
text |
A character vector |
sep |
character string. A string to be written to the connection after each line of text. |
Returns NULL
invisibly
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.