[R] textConnection

Gabor Grothendieck ggrothendieck at gmail.com
Tue May 15 13:50:38 CEST 2007


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.
>
>



More information about the R-help mailing list