[
https://issues.apache.org/jira/browse/ARROW-11441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17461011#comment-17461011
]
Neal Richardson commented on ARROW-11441:
-----------------------------------------
Weston's suggestion works:
{code}
> x <- c("a,b", "1,2", "3,4")
> b <- buffer(charToRaw(paste(x, collapse = "\n")))
> read_csv_arrow(b)
a b
1 1 2
2 3 4
{code}
read_csv_arrow already can read an arrow::Buffer, we just have to put the
character vector into a Buffer. There's surely a more efficient way to do that,
but this would work.
> [R] Read CSV from character vector
> ----------------------------------
>
> Key: ARROW-11441
> URL: https://issues.apache.org/jira/browse/ARROW-11441
> Project: Apache Arrow
> Issue Type: New Feature
> Components: R
> Reporter: Neal Richardson
> Priority: Minor
> Fix For: 8.0.0
>
>
> `readr::read_csv()` lets you read in data from a character vector, useful for
> (e.g.) taking the results of a system call and reading it in as a data.frame.
> {code}
> > readr::read_csv(c("a,b", "1,2", "3,4"))
> # A tibble: 2 x 2
> a b
> <dbl> <dbl>
> 1 1 2
> 2 3 4
> {code}
> One solution would be similar to ARROW-9235, perhaps, treating it as a
> textConnection.
> Another solution is to write to a tempfile.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)