[R] textConnection on List

2010-10-10 Thread Santosh Srinivas
I'm trying to optimize some code that I have 

I have a list of delimited text in a list (see below). I want to do a
read.table via a text connection so that I can get the delimited values into
a table ... 
Something like ... tmp_MF_Data_F - read.table(textConnection(tmpTxtList),
sep=';', quote = '') ... but this fails ...

Any idea how to go about it?

Thanks for the help.


head(tmpTxtList)
[[1]]
[1] \106270;BIRLA SUN LIFE CAPITAL PROTECTION ORIENTED FUND-3 YRS-
DIVIDEND;10.3287;10.3287;0.;01-Apr-2008\

[[2]]
[1] \106269;BIRLA SUN LIFE CAPITAL PROTECTION ORIENTED FUND-3 YRS-
GROWTH;10.3287;10.3287;0.;01-Apr-2008\

[[3]]
[1] \102767;Birla Sun Life Dynamic Bond Fund-Retail
Plan-Growth;12.6832;12.6832;12.6832;01-Apr-2008\

[[4]]
[1] \102766;Birla Sun Life Dynamic Bond Fund-Retail Plan-Quarterly
Dividend;10.5396;10.5396;10.5396;01-Apr-2008\

[[5]]
[1] \102855;Birla Sun Life Fixed Maturity Plan - Annual  Series
3-Dividend;9.9830;9.7833;9.9830;01-Apr-2008\

[[6]]
[1] \102856;Birla Sun Life Fixed Maturity Plan - Annual  Series
3-Growth;12.3964;12.1485;12.3964;01-Apr-2008\

__
R-help@r-project.org 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.


Re: [R] textConnection on List

2010-10-10 Thread Santosh Srinivas
I think unlist did the trick ... I used  

tmpData - unlist (tmpTxtList)
tmp_MF_Data_F - read.table(textConnection(tempTxt), sep=';', quote = '')
write.table(tmp_MF_Data_F,file=MF_Data_F.txt, append=T, sep =|,
col.names=F, row.names=F, quote=F)



-Original Message-
From: Santosh Srinivas [mailto:santosh.srini...@gmail.com] 
Sent: 11 October 2010 11:05
To: 'r-help'
Subject: textConnection on List

I'm trying to optimize some code that I have 

I have a list of delimited text in a list (see below). I want to do a
read.table via a text connection so that I can get the delimited values into
a table ... 
Something like ... tmp_MF_Data_F - read.table(textConnection(tmpTxtList),
sep=';', quote = '') ... but this fails ...

Any idea how to go about it?

Thanks for the help.


head(tmpTxtList)
[[1]]
[1] \106270;BIRLA SUN LIFE CAPITAL PROTECTION ORIENTED FUND-3 YRS-
DIVIDEND;10.3287;10.3287;0.;01-Apr-2008\

[[2]]
[1] \106269;BIRLA SUN LIFE CAPITAL PROTECTION ORIENTED FUND-3 YRS-
GROWTH;10.3287;10.3287;0.;01-Apr-2008\

[[3]]
[1] \102767;Birla Sun Life Dynamic Bond Fund-Retail
Plan-Growth;12.6832;12.6832;12.6832;01-Apr-2008\

[[4]]
[1] \102766;Birla Sun Life Dynamic Bond Fund-Retail Plan-Quarterly
Dividend;10.5396;10.5396;10.5396;01-Apr-2008\

[[5]]
[1] \102855;Birla Sun Life Fixed Maturity Plan - Annual  Series
3-Dividend;9.9830;9.7833;9.9830;01-Apr-2008\

[[6]]
[1] \102856;Birla Sun Life Fixed Maturity Plan - Annual  Series
3-Growth;12.3964;12.1485;12.3964;01-Apr-2008\

__
R-help@r-project.org 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.