[R] Help to compare...

Hanke, Alex HankeA at mar.dfo-mpo.gc.ca
Mon Mar 22 20:19:31 CET 2004


DF<-data.frame(V1=c(0,8,6,4,3,1,2,9,6,5),V2=1:10)
DF[((DF$V1>=2 & DF$V1<8)*1:10)[2:8],]

-----Original Message-----
From: joseclaudio.faria [mailto:joseclaudio.faria at terra.com.br] 
Sent: March 22, 2004 1:28 PM
To: R-help at stat.math.ethz.ch
Subject: [R] Help to compare...


Dear list,

I'm needing submit values (V1 = 8,6,4,3,1,2,9) (Id = 2:8) of a data.frame
(DF), like below

Id  V1  V2 ...
1    0    1  ...
2    8    10  ...
3    6    2  ...
4    4    4  ...
5    3    7  ...
6    1    8  ...
7    2    6  ...
8    9    7  ...
9    6    1  ...
10  5    4  ...

to selection (>=2 and <8) for remanescents like below:

Id  V1  V2 ...
1    0    1  ...
2    .     10  ...
3    6    2  ...
4    4    4  ...
5    3    7  ...
6    .     8  ...
7    2    6  ...
8    .     7  ...
9    6    1  ...
10  5    4  ...

how to do that betther with R? Is there a command to compare all to same
time?

I would be very thankful.

Yours sincerly

José Cláudio Faria
UESC/DCET
Brasil
73-634.2779
joseclaudio.faria at terra.com.br
jc_faria at uol.com.br

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




More information about the R-help mailing list