Learn R Programming

ctypesio (version 0.1.2)

scan_dbl: Read values encoded as characters strings

Description

A lightweight wrapper around the standard scan() function.

Usage

scan_dbl(con, n = 1, quiet = TRUE, ...)

scan_int(con, n = 1, quiet = TRUE, ...)

scan_str(con, n = 1, quiet = TRUE, ...)

Value

Value of the given type

Arguments

con

Connection object or raw vector. Connection objects can be created with file(), url(), rawConnection() or any of the other many connection creation functions.

n

Number of elements to read. Default: 1

quiet

Default: TRUE

...

further arguments passed to scan()

Details

These functions are useful when the numeric values are encoded as strings written to the file, rather than as binary data. Values must be delimited by whitespace or other specified separator. See documentation for scan() for more information.

See Also

Other data input functions: read_f64(), read_hex(), read_raw(), read_str(), read_uint8()

Examples

Run this code
con <- textConnection(r"(
  type
  20 30
  3.14159
)")

scan_str(con)
scan_int(con)
scan_int(con)
scan_dbl(con)
close(con)

Run the code above in your browser using DataLab