Hi Arun,

Worked perfectly, one last question how to read the matrices which have the
dollar sign?

Thanks again.


On Thu, Sep 19, 2013 at 3:46 PM, arun kirshna [via R] <
ml-node+s789695n4676510h87@n4.nabble.com> wrote:

> Hi Elio,
> Try this:
> library(stringr)
>  lines1<-str_trim(gsub("\t"," ",readLines("elio.txt")))
>  lst1<-lapply(split(lines1,cumsum(lines2=="")),function(x) x[x!=""])
>
> lst2<- lapply(lst1[lapply(lst1,length)>0],function(x)
> as.matrix(read.table(text=x,row.names=1)))
> names(lst2)<- paste0("m",seq_along(lst2))
>
> lst2[1:2]
> #$m1
>  #    aa5 aa10 b253 b254
> #aa5    0    1    1    1
> #aa10   1    0    1    1
> #b253   1    1    0    1
> #b254   1    1    1    0
> #
> #$m2
>  #   aa5 aa9 b27 b29
> #aa5   0   1   1   1
> #aa9   1   0   1   1
> #b27   1   1   0   1
> #b29   1   1   1   0
>
>
> A.K.
>
> ________________________________
> From: Elio Shijaku <[hidden email]<http://user/SendEmail.jtp?type=node&node=4676510&i=0>>
>
> To: arun <[hidden email]<http://user/SendEmail.jtp?type=node&node=4676510&i=1>>
>
> Sent: Thursday, September 19, 2013 3:27 AM
> Subject: Re: binary symmetric matrix combination
>
>
>
> Hi Arun,
>
> Please find attached the text file. Let me know if anything else is
> needed. Thanks a lot for your continuous help.
>
> Best,
>
> Elio
>
> ______________________________________________
> [hidden email] <http://user/SendEmail.jtp?type=node&node=4676510&i=2>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.
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://r.789695.n4.nabble.com/binary-symmetric-matrix-combination-tp4675440p4676510.html
>  To unsubscribe from binary symmetric matrix combination, click here<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4675440&code=c2VsaXVzQGdtYWlsLmNvbXw0Njc1NDQwfDMwOTY1Njg2Mg==>
> .
> NAML<http://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://r.789695.n4.nabble.com/binary-symmetric-matrix-combination-tp4675440p4676522.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]

