[R] Creating file from raw connection

Sebastien Bihorel
Fri, 29 May 2020 20:26:13 -0000

Thanks Duncan

From: Duncan Murdoch <murdoch.duncan at gmail.com>
Sent: Friday, May 29, 2020 15:36
To: Sebastien Bihorel <Sebastien.Bihorel at cognigencorp.com>; r-help at
r-project.org <r-help at r-project.org>
Subject: Re: [R] Creating file from raw connection
?
On 29/05/2020 3:00 p.m., Sebastien Bihorel via R-help
wrote:
> Hi,
>
> Let's say I can extract the content of an Excel .xlsx file stored in a
database and store it as raw content in an R object. What would be the proper
way to "create" a .xlsx file and "transfer" the content of
this obj into it? I took the example of an Excel file, but my question would
extend to any kind of binary file.
>
> Thank you in advance for your input

It depends on how the .xlsx was put in to the database and then
extracted into R, but if it's just a copy of a file from disk,
writeBin() will write it without changes.

Duncan Murdoch