R/read_float.R

Defines functions read_float

Documented in read_float

#' Read a float from a binary connection
#'
#' Reads 4 bytes in little Endian and converts to a float
#'
#' @param con a file connection
#'
#' @return a numeric
#'
#' @importFrom magrittr %>%
read_float <- function(con) {
    readBin(con = con, what = "raw",
            size = 1, n = 4,
            endian = "little") %>%
        readBin(what = "numeric",
                size = 4,
                endian = "little") %>%
        return()
}
barefootbiology/heyexr documentation built on July 9, 2022, 3:35 a.m.