[R] help

jim holtman jholtman at gmail.com
Tue Feb 24 19:26:51 CET 2015


Where did 36 pairs come from?  6 things taken 2 at a time is 15 pairs.
Here is an example of how it might be done:

library(seqinr)
Seq1 <- read.fasta(file ="C:/D.fasta")
# are you doing each pair so that you have 6 taken 2 at a time for 15 plots?
pairs <- combn(6, 2)  # create the pairings
# now the loop for the plots
for (col in seq(ncol(pairs))){
    dotPlot(Seq1[[pairs[1, col]]], Seq1[[pairs[2, col]]])
}


Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.


On Tue, Feb 24, 2015 at 10:32 AM, Ron Flatau <ronflatau at gmail.com> wrote:
> I try to create a dot plot loop for 6 protein, that mean that i want to do
> dot plot to 36 pairs of protein in a loop
> library(seqinr)
> Seq1 <- read.fasta(file ="C:/D.fasta")
> Protinename1 <- Seq1[[1]]
> Protinename2 <- Seq1[[2]]
> Protinename3 <- Seq1[[3]]
> Protinename4 <- Seq1[[4]]
> Protinename5 <- Seq1[[5]]
> Protinename6 <- Seq1[[6]]
> dotPlot(Protinename1 , Protinename3)
>
> i have no idea how to create a loop for this script
>
> thank you for your help
>
>         [[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.



More information about the R-help mailing list