Browse Source

as.data.frame, ...

master
boB Rudis 5 years ago
parent
commit
3f9e30ea4c
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 7
      R/as-data-frame.R
  2. 9
      man/as.data.frame.insensitive.Rd

7
R/as-data-frame.R

@ -3,16 +3,19 @@
#' @param x an object returned from a call to [httr::headers()]. This is
#' a `list` classed as `insensitive` which is pretty generic but
#' this method has a pretty thin use case and shouldn't cause issues.
#' @param row.names `NULL` or a character vector giving the row names for the
#' data frame. Missing values are not allowed.
#' @param optional ignored
#' @param tbl if `TRUE` (the default) will class the output as a tibble
#' @param ... ignored
#' @param stringsAsFactors _always_ `FALSE` (unless you say otherwise)
#' @export
as.data.frame.insensitive <- function(x, tbl=TRUE, ..., stringsAsFactors = FALSE) {
as.data.frame.insensitive <- function(x, row.names = NULL, optional = FALSE, tbl=TRUE, ..., stringsAsFactors = FALSE) {
data.frame(
name = names(x),
value = unlist(x, use.names = FALSE),
row.names = NULL,
row.names = row.names,
check.names = FALSE,
stringsAsFactors = stringsAsFactors
) -> out

9
man/as.data.frame.insensitive.Rd

@ -4,14 +4,19 @@
\alias{as.data.frame.insensitive}
\title{Turn `httr::headers()`` objects into a data frame}
\usage{
\method{as.data.frame}{insensitive}(x, tbl = TRUE, ...,
stringsAsFactors = FALSE)
\method{as.data.frame}{insensitive}(x, row.names = NULL,
optional = FALSE, tbl = TRUE, ..., stringsAsFactors = FALSE)
}
\arguments{
\item{x}{an object returned from a call to \code{\link[httr:headers]{httr::headers()}}. This is
a \code{list} classed as \code{insensitive} which is pretty generic but
this method has a pretty thin use case and shouldn't cause issues.}
\item{row.names}{\code{NULL} or a character vector giving the row names for the
data frame. Missing values are not allowed.}
\item{optional}{ignored}
\item{tbl}{if \code{TRUE} (the default) will class the output as a tibble}
\item{...}{ignored}

Loading…
Cancel
Save