Skip to content
Back to formatted view

Raw Message

Message-ID: <551BB4FF.6030700@stats.ox.ac.uk>
Date: 2015-04-01T09:06:07Z
From: Brian Ripley
Subject: read.table with a "memory connection"
In-Reply-To: <mfgbjl$vg9$1@ger.gmane.org>

On 01/04/2015 09:52, Thomas wrote:
> Hi,
>
> Is there a way to create "memory connections" in R which are valid
> connections to read.table (and associated function)? By saying "memory
> connection" I refer to something like a connection created from a simple
> character object (of length 1) - instead of having the content in a
> physical file just have it in an ordinary R object. More or less the
> equivalent to the std::istringstream class in C++.

I believe you are looking for 'text connections':  see the 'text' 
argument to read.table() and ?textConnection.


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK