Re: [R] R: characters

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.be>
Date: Wed 17 Aug 2005 - 21:00:53 EST

you could convert it to a data.frame, i.e.,

a <- rbind(c(T, T, F), c(F, F, T))
a[!a] <- ""
as.data.frame(a)

I hope it helps.

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
     http://www.student.kuleuven.be/~m0390867/dimitris.htm


> hi all
>
> assume that i have the following table
>
> a=rbind(c(T,T,F),c(F,F,T))
>> a
> [,1] [,2] [,3]
> [1,] TRUE TRUE FALSE
> [2,] FALSE FALSE TRUE
>
> I would like to change all the FALSE entries to a blank. how can i
> do
> this?
>
> i could simply use
>
> a[a==F]=""
> a
>
> but then how would i remove the " " from the entries.
>
> i know that this should be very easy!!!
>
> /
> allan


> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Aug 17 21:04:30 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:39:50 EST