I found the data you sent with the help of David Winsemius.  Are you just
trying to count the number of amino acids in each of the groups?  Is it
something like this:

> # split by the Label
> x <- split(amino, amino$Label)
> # now count the number of aminos in each group
> lapply(x, function(.lab){
+     table(unlist(strsplit(.lab$Peptide, '')))
+ })
$cleaved
 A  C  D  E  F  G  H  I  K  L  M  N  P  Q  R  S  T  V  W  Y
79  6 22 66 76 30  8 62 10 83 14 59 62 81 35 58 47 62  6 46
$noncleaved
  A   C   D   E   F   G   H   I   K   L   M   N   P   Q   R   S   T   V
W   Y
179 121  93  49  40 112  38  78 116  73  48 199  55  99 109 203 131 115  47
79


On Sat, Jan 16, 2010 at 8:04 PM, che <fadialn...@live.com> wrote:

>
> Thank you very much for your help,
>
> you have been excused to have a suspicion, but  dont worry i am not
> cheating, it is not a home work, rather it is a pre-project task that i
> have
> to deal with in order to prepare to my project, and i cant understand this
> programming things alone, i tried my best but still i cant deal with it
> properly, i am studying master and PhD in bioinformatics, and i need to
> develop a good understanding of  programming languages. still a beginner
> but
> i start to have some fears ... what ever you send me, i study it and know
> exactly how it works, and believe me that can help a lot to develop my
> skills. Moreover i am dealing with it in a very honesty way that does not
> break any academic regulations.
>
> thanks again i will try what you sent me ..
>
> Yours
>
> che wrote:
> >
> > hello every one,
> >
> > How to function more than one loop in R? I have the following problem to
> > be solved with the a method of three loops, can you help me please?
> >
> > The data is attached with this message.
> >
> > The data is composed of two parts, cleaved (denoted by “cleaved”) and non
> > cleaved (denoted by “noncleaved”).
> > • to access to the ith peptide, you can use X$Peptide[i]
> > • to access to the ith label, you can use X$Label[i]
> >
> > define a set of amino acids using string or other format if you want
> > amino.acid<-"ACDEFGHIKLMNPQRSTVWY"
> > define two matrices with initialised entries, one for cleaved  peptides
> > and one for none-cleaved peptides
> > • matrix(0,AA,mer),where AA is the number of amino acids, and mer is the
> > number
> > of residues detected from data using the nchar function
> > • both matrices have the same size, the number of rows being equal to the
> > number
> > of amino acids and the number of columns being equal to the number of
> > residues
> > in peptides
> >
> >
> >  use one three-loop structure to detect the frequency of amino acids in
> > cleaved peptides
> > and one three-loop structure to detect the frequency of amino acids in
> > non-cleaved
> > peptides. They should not be mixed in one three-loop structure. The best
> > way to
> > handle this is to use a function. The three-loop structure is exampled as
> > below
> > for(i in 1:num)#scanning data for all peptides, where num means the
> number
> > of peptides
> > {
> > for(j in 1:mer)#scanning all residues in a peptide
> > {
> > for(k in 1:AA)#scanning 20 amino acids
> > {
> > #actions
> > }
> > }
> > }
> >  http://n4.nabble.com/file/n1015851/hiv.dat hiv.dat
> >
>
> --
> View this message in context:
> http://n4.nabble.com/More-than-on-loop-tp1015851p1015863.html
>  Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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<http://www.r-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?

        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to