plot_tweets: Plot tweets on a static map

Description Usage Arguments Details Value See Also Examples

View source: R/plots.R

Description

Plot tweets on a static map with base plot.

Usage

1
plot_tweets(data, region = ".", alpha = 0.01, ...)

Arguments

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.

...

Extra arguments passed to polygon or lines.

Details

This function can be used to generate high resolution spatial plots of tweets. 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.

Value

Maps where each dot represents a tweet.

See Also

map, iso3166

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 

library(Twitmo)

# Plot tweets on mainland USA
mytweets <- load_tweets(system.file("extdata", "tweets_20191027-141233.json", package = "Twitmo"))

plot_tweets(mytweets, region = "USA(?!:Alaska|:Hawaii)", alpha=1)
# Add title
title("My tweets on a map")

## End(Not run)

Twitmo documentation built on Dec. 11, 2021, 10:01 a.m.