KateHyoung / UTDEventData

An R package to retrieve political event data from the UTD API server
GNU Lesser General Public License v3.0
16 stars 7 forks source link

More options for quering Dyad #3

Open ysapolovych opened 6 years ago

ysapolovych commented 6 years ago

1.Is it possible to query Dyad with for 2 and more source/target countries? E.g. I want to search for events where source actor is CHN, and target actors are USA, CAN and RUS. I've tried several options like:

#writing in line
returnDyad('PHOENIX_RT', "CHN", "USA" "CAN" "RUS")
#making a vector
returnDyad('PHOENIX_RT', "CHN", c("USA", "CAN", "RUS")) 
#making a list
returnDyad('PHOENIX_RT', "CHN", list("USA", "CAN", "RUS"))

None work properly however - when I run it with sendQuery, I just get an empty data frame.

2.Can I query only by source/target? E.g. I need all events where source country is AFG. So I'd want to write somethign like returnDyad('PHOENIX_RT',"AFG", ) But there is no default argument for the source or target section - so apparently I can't leave it blank.

So perhaps there are solutions, but I can't find any?

KateHyoung commented 6 years ago

Unfortunately, the dyad function does not work with multiple countries either one of the dyad. I would like to suggest you can extract data by targeting countries with pullData() and suet the cases you want.

For example, pullData(api_key, "Phoenix_rt", list("USA", "CAN", "RUS", "AFG"), "20171031", "20181001")

ysapolovych commented 6 years ago

Well, I suppose dyad is really supposed to comprise of two parts:) Your workaround is surely doable, though it will take additional subsetting to get the data I need if I pull records this way (without specifying source/target). Which is not that hard of course, I just think having a more precise search would be absolutely neat.