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

From: Bert Gunter <gunter.berton_at_gene.com>
Date: Mon, 23 May 2011 10:52:42 -0700

Hi:

On Mon, May 23, 2011 at 7:52 AM, CAR <acasusa_at_gmail.com> wrote:
> Hi everybody!!
>
> I'm trying to assign boolean values to a column in a matrix depending on the
> number of times present in another column. I have no clue,

Sorry, I don't have time to help. But have you read "The Introduction to R" tutorial where you might find sufficient info to help you solve problems like this? It's well written (IMHO) and not too long (also IMHO). Cheers,
Bert

I have been 2
> days looking for a way, if somebody knows what kind of functions I need to
> use I will really apreciate it.
>
> example:
>
> Color Type  Mark1 Mark2 Mark3
> Red   high    139    P       alpha
> blue   low    140    P        alpha
> Green high   141    S       alpha
> Yellow low    142   S        beta
> Red    high   143    P       gamma
>
> If we only take into account columns Mark1, Mark2 and Mark3. I would like to
> ask R to write another column with 0=one; 1=more than one.
> If alpha is present for more than one Mark 2, so P and S, then I will like
> to assign value 1 if only for one then assign the value 0.
>
> Thanks for your help
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/How-do-I-assign-boolean-o-1-values-to-a-column-tp3544304p3544304.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.
>

-- 
"Men by nature long to get on to the ultimate truths, and will often
be impatient with elementary studies or fight shy of them. If it were
possible to reach the ultimate truths without the elementary studies
usually prefixed to them, these would not be preparatory studies but
superfluous diversions."

-- Maimonides (1135-1204)

Bert Gunter
Genentech Nonclinical Biostatistics

______________________________________________
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 Mon 23 May 2011 - 17:54:33 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 Mon 23 May 2011 - 18: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