[R] subset exact values
tsippel
tsippel at gmail.com
Fri Jan 23 00:29:46 CET 2009
Hi-
I need to subset the following data by the column 'dal' for values that
equal the regular interval seq(0, 150, by=0.5) exactly....
....excluding rows with irregular 'dal' values such as c(2.888958,
2.891620), etc.
data<-data.frame(id=id, dal=dal, date=date, mu.x=mu.x)
$dal
[1] 0.000000 0.500000 1.000000 1.500000 2.000000 2.500000 2.888958 2.891620
3.000000 3.245405 3.500000 3.688333 4.000000 4.500000 4.738831 4.855949
[17] 4.993437 5.000000 5.251875 5.252037 5.500000
$id
[1] STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3
STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3 STM05.3
[19] STM05.3 STM05.3 STM08.2
$date
[1] "2005-02-26 00:00:00" "2005-02-26 12:00:00" "2005-02-27 00:00:00"
"2005-02-27 12:00:00" "2005-02-28 00:00:00" "2005-02-28 12:00:00"
[7] "2005-02-28 21:20:06" "2005-02-28 21:23:56" "2005-03-01 00:00:00"
"2005-03-01 05:53:23" "2005-03-01 12:00:00" "2005-03-01 16:31:12"
[13] "2005-03-02 00:00:00" "2005-03-02 12:00:00" "2005-03-02 17:43:55"
"2005-03-02 20:32:34" "2005-03-02 23:50:33" "2005-03-03 00:00:00"
[19] "2005-03-03 06:02:42" "2005-03-03 06:02:56" "2005-03-03 12:00:00"
$mu.x
[1] 176.2730 176.3550 176.4996 176.6969 176.9209 177.1511 177.3197 177.3197
177.3109 177.2958 177.5862 177.7929 177.7612 177.6563 177.6030 177.6421
[17] 177.6932 177.6949 177.7377 177.7377 177.7468
Why does the following subset code give me rows of data with irregular 'dal'
values which do not exactly match values in 'seq' below?
seq<-seq(0, 150, 0.5)
reg<-subset(data, dal=seq, select=c(id, dal, date, mu.x))
Thanks,
Tim
--
View this message in context: http://www.nabble.com/subset-exact-values-tp21615855p21615855.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list