readFeather: Read data frame from raw

View source: R/feather.R

readFeatherR Documentation

Read data frame from raw

Description

Reads a feathered data frame via a temporary file. Note that the feather package handles files only. First writes object to temporary file before reading it back as a data frame.

Usage

readFeather(object)

Arguments

object

Raw content to read as feather file

Value

Data frame as tibble::tibble

Examples

## Not run: 
# Suppose that you have a HTTP response with a binary response body encoding
# a feathered data frame.
readFeather(httr::content(res))

# More specifically, say you have a Plumber handler as follows. It handles
# a POST request with a feather body and responds with a feather body.

  #* Echo feathered data frame
  #* @parser feather
  #* @serializer feather
  #* @post /echo-df
  function(req) req$body

# Upload a feather and read-back the echo using this call. It answers a three
# by one tibble.
readFeather(httr::content(upload_feather(data.frame(a = c(1, 2, 3)),
  "http://localhost:7939/echo-df")))

## End(Not run)

royratcliffe/canny.tudor documentation built on Oct. 17, 2022, 4:17 a.m.