Learn R Programming

assertive.files (version 0.0-2)

as.character.file: Convert file connections to strings

Description

as.character method for file connections.

Usage

"as.character"(x, ...)

Arguments

x
A file connection.
...
Not currently used.

Value

A string containing the target location of the file connection.

See Also

file, summary.connection, as.character

Examples

Run this code
rprofile <- file.path(R.home("etc"), "Rprofile.site")
fcon <- file(rprofile)
assertive.base::assert_all_are_true(identical(as.character(fcon), rprofile))
close(fcon)

Run the code above in your browser using DataLab