Description Usage Arguments Details Value See Also Examples
Plot the locations of certain hashtag on a static map with base plot.
1 2 3 4 5 6 7 8 | plot_hashtag(
data,
region = ".",
alpha = 0.01,
hashtag = "",
ignore_case = TRUE,
...
)
|
data |
A data frame of tweets parsed by load_tweets or returned by pool_tweets. |
region |
Character vector specifying region. Returns a world map by default. For higher resolutions specify a region. |
alpha |
A double between 0 and 1 specifying the opacity of plotted points. See iso3166 for country codes. |
hashtag |
Character vector of the hashtag you want to plot. |
ignore_case |
Logical, if TRUE will ignore case of hashtag. |
... |
Extra arguments passed to polygon or lines. |
This function can be used to generate high resolution spatial plots of hashtags
Works with data frames of tweets returned by pool_tweets as well as data frames
read in by load_tweets and then augmented by lat/lng coordinates with lat_lng.
For larger view resize the plot window then call plot_tweets
again.
Maps where each dot represents a tweet.
map, iso3166
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Not run:
library(Twitmo)
# load tweets (included in package)
mytweets <- load_tweets(system.file("extdata", "tweets_20191027-141233.json", package = "Twitmo"))
# Plot tweets on mainland USA region
plot_hashtag(mytweets,
region = "USA(?!:Alaska|:Hawaii)",
hashtag = "breakfast",
ignore_case=TRUE,
alpha=1)
# Add title
title("My hashtags on a map")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.