hrbrmstr / newsflash

Tools to Work with the Internet Archive and GDELT Television Explorer in R
90 stars 9 forks source link

Issues with the timespan argument in query_tv #3

Closed yeedle closed 7 years ago

yeedle commented 7 years ago

A call such as:

newsflash::query_tv("deep state",
                     timespan = NULL,
                     start_date = begin, end_date = end)

will result in

## Error in if (is.null(timespan) | (tolower(timespan) != "all")) { : 
##   argument is of length zero

It's a simple bug: the | operator is not short-circuiting, you gotta use || for that.

Another "issue", if you can call it that, is that setting start_date and end_date does not automatically change the value of timespan from "all" to NULL or something else, silently giving you back results for all time unles timespane is explicitly set to something else. I think a more intuitive behavior would be if the user sets start_date and end_date to assume timespan is not "all".