Re: [R] How do I assign boolean (o,1) values to a column?

From: Steve Lianoglou <mailinglist.honeypot_at_gmail.com>
Date: Tue, 24 May 2011 16:30:20 -0400

Hi,

On Tue, May 24, 2011 at 9:46 AM, Xenimes <acasusa_at_gmail.com> wrote:
> Thank you David and Steve,
>
> Yes all this data are already in R and in csv files.

That's nice, but as I said before: please use 'dput' or 'dump' on your data.frame (or some reasonable portion of it) and paste that result into an email so that anyone trying to help you can copy that and paste it into an R session so they can more easily help you.

-steve

> Sorry for not being clear.
>
> I have this:
>
> Codes1and3[1:5,c(1:5)]
>        Mark_2 pop      Mark_1  Mark_3 age
> 1       P       A1      139     alpha   2
> 2       P       A1      140     alpha   2
> 3       P       A1      141     gamma   2
> 4       S       A1      142    gamma   2
> 5       S       A1      143    alpha   2
> 6       T       A2      144     alpha   2
> 7       T       A2      145     alpha   2
>
> I’m comparing Marks 1 and 3, then I need to know if the ones in Mark_2 in
> the general table have 1 or more interactions with Mark 3. For example here
> “P” appears in the same row than “alpha” and then in the same than “gamma”,
> then there are 2 interactions, so in a Boolean code it should be 1 (more
> than1 interaction).
> The same for “S”. But “T” only interacts with “alpha”, that will make it
> only one interaction = 0.
>
> The next colum I need is Code 1 referent to code 3 and in this case it
> should look like this:
>        Code 1_3
> 1       1
> 2       1
> 3       1
> 4       1
> 5       1
> 6       0
>
> I have tried to count but, of course in this case it will always be one,
> because they are linked in each row once, how can I consider the other rows?
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/How-do-I-assign-boolean-o-1-values-to-a-column-tp3544304p3547156.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_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.
>

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

______________________________________________
R-help_at_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.
Received on Tue 24 May 2011 - 20:33:13 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 24 May 2011 - 20:40:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive