Dear R-list,

I am having troubles selecting rows from a very large data-set  
containing distances between capitals.

The structure of the data-set looks like this:

        numa    ida             numb    idb             kmdist  midist
1        2              USA     20              CAN     731     456
2        2              USA     31              BHM     1623    1012
3        2              USA     40              CUB     1813    1130


I want to select a subset of these dyads, and have tried the following  
code:

subset(capdist,ida == c("DEN","SWD","FIN") & idb ==  
c("DEN","SWD","FIN"))

This should ideally give me the dyads involving only Denmark, Sweden  
and Finland, however i get the error message:

[1] numa   ida    numb   idb    kmdist midist
<0 rows> (or 0-length row.names)
Warning messages:
1: In is.na(e1) | is.na(e2) :
   longer object length is not a multiple of shorter object length
2: In `==.default`(ida, c("DEN", "SWD", "FIN")) :
   longer object length is not a multiple of shorter object length
3: In is.na(e1) | is.na(e2) :
   longer object length is not a multiple of shorter object length
4: In `==.default`(idb, c("DEN", "SWD", "FIN")) :
   longer object length is not a multiple of shorter object length

Any help would be greatly appreciated,

Best, Thomas Jensen
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to