Message-ID: <ed8c0cfa-a67c-4246-6523-f203f6d5a209@dewey.myzen.co.uk>
Date: 2016-12-07T14:41:43Z
From: Michael Dewey
Subject: calculate correlations
In-Reply-To: <1066086341.1704879.1481110001838@mail.yahoo.com>
If I understand this correctly you are choosing all the rows from each
of cod and lnc which contain .c (ie any character followed by a C) and
deleting the first column from each of cod and lnc. You then correlate
them so that you get the correlation between corresponding columns of
each. Since you do not tell us how you know which column is which it is
hard to answer the question of how R will know.
On 07/12/2016 11:26, Elham - via R-help wrote:
> Hi All,I have 11 human RNA-seq data (control/treatment),The effect of various drugs on various cancers,I want to calculate the genes-lncRna correlations for all tumors considered together for network,I did differential expression analysis and prepared normalized values (rpkm) of coding and lncoding in two separate file and import them to R, then transpose them and now I want to calculate corr by this function:
> control.corr=cor(cod[grep(".C",cod$name),-1],lnc[grep(".C",lnc$name),-1],method = "spearman")
>
> if I understand true,I should write the numbers of columns whose related to control,then I counted all of control`s column and wrote 23 .now my question is,how does R understand what column is control and what is treatment?
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>
--
Michael
http://www.dewey.myzen.co.uk/home.html