read_f64 | R Documentation |
Read floating point numbers into a standard R vector of doubles
read_f64(con, n = 1, endian = NULL)
read_f32(con, n = 1, endian = NULL)
read_f16(con, n = 1, endian = NULL)
read_bfloat(con, n = 1, endian = NULL)
read_dbl(con, n = 1, endian = NULL)
read_float(con, n = 1, endian = NULL)
read_half(con, n = 1, endian = NULL)
con |
Connection object or raw vector. Connection objects can be
created with |
n |
Number of elements to read. Default: 1 |
endian |
Ordering of bytes within the file when reading multi-byte values.
Possible values: 'big' or 'little'.
Default: NULL indicates that
endian option should be retrieved from the connection object if possible
(where the user has used |
8 byte floating point numbers. read_f64()
also available as read_dbl()
4 byte floating point numbers. read_f32()
also available as read_float()
2 byte floating point numbers. read_f16()
also available as read_half()
. Consists of 1 sign bit,
5 bits for exponent and 10 bits for fraction.
2 byte floating point numbers in the bfloat format read_bfloat()
.
Consits of 1 sign bit, 8 bits fo exponent and 7 bits for fraction.
vector of double precision floating point numbers
Other data input functions:
read_hex()
,
read_raw()
,
read_str()
,
read_uint8()
,
scan_dbl()
# Raw vector with 16 bytes (128 bits) of dummy data
data <- as.raw(1:16)
con <- rawConnection(data, 'rb')
read_f64(con, n = 1) # Read a 64-bit double-precision number
read_f16(con, n = 4) # Read 4 x 16-bit half-precision number
close(con)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.