Re: [R] textConnection

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Tue, 15 May 2007 07:50:38 -0400

  1. closeAllConnections() will close all open connections so

con <- textConnection(Line)
closeAllConnection()
# now there are no open connections left

2. close() will close an individual connection:

con <- textConnection(Line)
scan(con, what = "")
close(con)

3. strsplit will split your line without using connections

 strsplit(gsub(" +", " ", Line), " ")

3a. This is the shorter for the case that there is exactly one space between words:

 strsplit(Line, " ")

On 5/15/07, elyakhlifi mustapha <elyakhlifi_mustapha_at_yahoo.fr> wrote:
> hello,
> I don't understand what's happen just before the textConnection function runs good but now it doesn't run
>
> > Line[1]
> [1] "if C325=. then C743=(C152/C103)*100| else C743=(C152/C325)*100"
> > textConnection(Line[1])
> Erreur dans textConnection(Line[1]) : toutes les connexions sont utilisées
>
> why R display that?
>
>
> _____________________________________________________________________________
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
> [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 15 May 2007 - 11:56:09 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 May 2007 - 12:31:43 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.