Description Usage Arguments Value See Also Examples
Get Twitter trends data.
1 2 3 4 5 6 7 8 |
woeid |
Numeric, WOEID (Yahoo! Where On Earth ID) or character
string of desired town or country. Users may also supply latitude
and longitude coordinates to fetch the closest available trends
data given the provided location. Latitude/longitude coordinates
should be provided as WOEID value consisting of 2 numeric values
or via one latitude value and one longitude value (to the
appropriately named parameters). To browse all available trend
places, see |
lat |
Optional alternative to WOEID. Numeric, latitude in degrees. If two coordinates are provided for WOEID, this function will coerce the first value to latitude. |
lng |
Optional alternative to WOEID. Numeric, longitude in degrees. If two coordinates are provided for WOEID, this function will coerce the second value to longitude. |
exclude_hashtags |
Logical, indicating whether or not to exclude hashtags. Defaults to FALSE–meaning, hashtags are included in returned trends. |
token |
a twitter token. |
parse |
Logical, indicating whether or not to parse return trends data. Defaults to true. |
data frame of trends data for a given geographical area.
Other trends:
trends_available()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
## Retrieve available trends
trends <- trends_available()
trends
## Store WOEID for Worldwide trends
worldwide <- trends$woeid[grep("world", trends$name, ignore.case = TRUE)[1]]
## Retrieve worldwide trends datadata
ww_trends <- get_trends(worldwide)
## Preview trends data
ww_trends
## Retrieve trends data using latitude, longitude near New York City
nyc_trends <- get_trends_closest(lat = 40.7, lng = -74.0)
## should be same result if lat/long supplied as first argument
nyc_trends <- get_trends_closest(c(40.7, -74.0))
## Preview trends data
nyc_trends
## Provide a city or location name using a regular expression string to
## have the function internals do the WOEID lookup/matching for you
(luk <- get_trends("london"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.