Hi,
ab<-read.table(header=F,file=textConnection("-1.3
1
-1.5
-1
1.5
-2.5
3
-0.5"))

length(which(ab >=-2 & ab<=2))


Bosken schrieb:
Hi all,

I take a simple dataset like this:

-1.3
1
-1.5
-1
1.5
-2.5
3
-0.5

Now I want to count how many values there are between -2 and 2.

The answer here would be 6.

Can anyone do this with R?

Thank you in advance.

Gr. Bosken

--
Eik Vettorazzi
Institut für Medizinische Biometrie und Epidemiologie
Universitätsklinikum Hamburg-Eppendorf

Martinistr. 52
20246 Hamburg

T ++49/40/7410-58243
F ++49/40/7410-57790

______________________________________________
[email protected] 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