Description Usage Arguments Details Value Author(s) See Also Examples
Plots tweets location and created time on Google Earth.
1 2 3 4 5 |
df |
Required. data.frame of tweets to plot. |
longitude |
Required. Column holding longitude. |
latitude |
Required. Column holding latitude. |
date.time |
Required. Column including creation time of tweets;
|
labels |
Required. Column holding labels. |
size |
Required. Column holding desired size of points. |
colour, |
optional. Column name that determines colours of points. |
colour.scale, |
optional, defaults to |
shape, |
optional. Shape to use for points. Defaults to
|
open, |
optional. Whether to open file in Google Earth.
Defaults to |
kmz |
Whether to also save the file as |
file.name |
Name of kml or kmz file, defaults to |
folder.name |
Name of folder where to save the kml or kmz file,
defaults to |
... |
Arguments to pass to |
Takes data.frame of tweets and plots coordinates on Google Earth, also
includes time variable (date.time). Choose size,
colour and labels of your liking.
Writes kml file and, optionally, opens it in Google Earth
(open = TRUE).
John Coene, jcoenep@gmail.com
\codestream2earth
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
library(twitteR)
# setup oauth
setup_twitter_oauth(consumer_key, consumer_secret, access_token=your_token,
access_secret=your_secret)
# search twitter
tweets <- searchTwitter("rstats", n = 2000, lang= "en",
geocode="34.052235,-118.243683,100mi")
# unlist
tw.df <- do.call("rbind", lapply(tweets, as.data.frame))
plot2earth(tw.df, "longitude", "latitude", "created",
"screenName", "retweetCount", "favorited",
colour.scale = colour.scale = RColorBrewer::brewer.pal(8, "BuPu"),
file.name = "rstats.kml")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.