[R] calculate correlations
lists at dewey.myzen.co.uk
Wed Dec 7 15:41:43 CET 2016
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
> 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