MaelKubli / RTwitterV2

R functions for Twitter's v2 API
MIT License
46 stars 6 forks source link

Getting error while using "full_archive_search_locations" function. #9

Closed ichbinkapil closed 2 years ago

ichbinkapil commented 2 years ago

Hey,

First of all, thanks for creating this package. I want to have a small sample data containing tweets having these two hashtags #Impfung OR #COVID. They should be around 200 spanning from "2020-01-01T00:00:01Z" to "2021-12-31T00:00:01Z". I also use location filter. But if I run the "full_archive_search_locations" function, I get an error:

"Error in vecseq(f, len, if (allow.cartesian || notjoin || !anyDuplicated(f__, : Join results in 873 rows; more than 226 = nrow(x)+nrow(i). Check for duplicate key values in i each of which join to the same group in x over and over again. If that's ok, try by=.EACHI to run j for each group to avoid the large allocation. If you are sure you wish to proceed, rerun with allow.cartesian=TRUE. Otherwise, please search for this error message in the FAQ, Wiki, Stack Overflow and data.table issue tracker for advice."

My codes are as following:

query <- '#Impfung OR #COVID'

lower <- "2020-01-01T00:00:01Z" upper <- "2021-12-31T00:00:01Z"

tmp <- full_archive_search_locations(token = Bearer_Token, search_query = query, n = 200, start_time=lower, end_time=upper, country = "DE")

Thanks in advance for your help.

Best

MaelKubli commented 2 years ago

Hi

I checked the parsing functions and it turns out if the API returns a user, places or media object multiple times, which can happen occasionally the matching breaks. I have now implemented a fix for this behaviour. I hope it works now. I couldn't really test it extensively at the moment. Just let me know if it works. I will then either close this issue or investigate further.

all the best, Maël

ichbinkapil commented 2 years ago

Hello!

Thank you for your quick reply and implementing a solution to this problem. I appreciate it. It is working fine now.

Best