Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

How I can get location(from user profile) and geo location of tweet?Interested specifically on South Africa users.I have tried using lookupcoords( ) function but I still get below error:Error in search_tweets("lang:es", geocode = Southafrica_coord, n = 20) : object 'Southafrica_coord' not found #289

Closed
ghost opened this issue Sep 6, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 6, 2018

Problem

Expected behavior

Reproduce the problem

## insert code here

rtweet version

## copy/paste output
packageVersion("rtweet")

Session info

## copy/paste output
sessionInfo()

Token

## copy/paste output
rtweet::get_token()
@Arf9999
Copy link

Arf9999 commented Sep 22, 2018

lookup_coords is not always succesful. I had the same issue - see my issue here with @mkearney's response: https://github.com/mkearney/rtweet/issues/237
and another thread here: https://github.com/mkearney/rtweet/issues/261

But here is a workaround that passes a request through to twitter's API:

Assuming that you want to search, try adding the following search string:

rtweet::search_tweets(q= search_term, n=200, 
                            geocode = "-30.55948,22.9375,1000mi",
                             token = token)

That will deliver tweets that are geocoded to a radius of 1000 miles from the approximate midpoint of South Africa, as well as tweets from any profile that indicates any recognisable location in that radius.

I hope that's helpful.

@hadley
Copy link
Collaborator

hadley commented Feb 25, 2021

Can you please provide a minimal reprex (reproducible example)? The goal of a reprex is to make it as easy as possible for me to recreate your problem so that I can fix it: please help me help you!

If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down the page. Please make sure your reprex is created with the reprex package as it gives nicely formatted output and avoids a number of common pitfalls.

@hadley
Copy link
Collaborator

hadley commented Feb 27, 2021

Reading this thread more carefully, it looks like @Arf9999 provided a solution, so I'm going to close for now.

@hadley hadley closed this as completed Feb 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants