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

Quering by event code in Phoenix RT #4

Closed ysapolovych closed 6 years ago

ysapolovych commented 6 years ago

I want to find all events in Phoenix RT with, say, code 90. I see that a dataframe generated by the query does indeed contain a column 'code' with a respective CAMEO code, but tableVar(apikey, 'PHOENIX_RT') shows no variable with such name. And indeed, I can't query it with returnRegExp (though no error is shown):

> evcode <- returnRegExp("5WSDHiyObsBUBu9JR4PVdg5E6lrkStRM", 'PHOENIX_RT', "90", "code")
> evcode
NULL

So can this be addressed in any way? An option quering by event code would be awesome!

KateHyoung commented 6 years ago

Can you please try this code? returnRegExp(api_key, "phoenix_rt","090", "code")

KateHyoung commented 6 years ago

I am also checking the function, tableVar( ) and put it up on Github once I fix it. Thank you!

ysapolovych commented 6 years ago

Thanks for the prompt response! You're right, I missed a digit, but even with the correct code it does not work. The value of evcode is still NULL. So if fixing tableVar( ) could do the thing - it'd be great.

KateHyoung commented 6 years ago

I have fixed the function and believe you will not have NULL anymore once throwing the above code in R. Thank you for pointing this out.

ysapolovych commented 6 years ago

It works well now. Thank you again!