I crawled some Tweets with R using the Twitter API. Now I am looking at the data and some of the Tweets have either a Tweet_id or user_id looking like this 5.03453238356772e-223
. This doesn't allow me to look for the respective screen_name. Anyone who knows how I could look up the screen name with a user oder tweet_id looking like this? Is it possible to convert it, to a more 'normal' format, like 49616273
?
Format Tweet_id and status_id: "e" in Tweet_id and/or status_id
201 views Asked by grethcool At
2
There are 2 answers
0
On
I expect that what has happened here is that something (maybe a spreadsheet program?) is mangling the Tweet and User IDs. These are 64-bit large integers. The Twitter API returns these values as strings, to avoid anything reformatting them. You'll need to go back and get the data again, and save the values in a format where the number is not converted to another format.
From the Twitter API documentation:
And as far as I know, it can be the case with R.
So if you are using the V1.1 API, use the
id_str
field instead of theid
field, and if you are using the V2 API (or were already using theid_str
field), store it as a string and do not cast it to int.