Title: | Website for Twitter analysis results |
---|---|
Description: | clamour provides a template for setting up a website to display the results of analysis of Twitter hashtags. |
Authors: | Luke Zappia [aut, cre] |
Maintainer: | Luke Zappia <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-02-07 03:26:58 UTC |
Source: | https://github.com/lazappi/clamour |
Produce a Markdown string with details of all the clamour analysis files in a directory. This function is primarily designed to be used in the index of a website so the list is automatically updated.
clamour_list(path = ".", ignore = c("index.Rmd", "about.Rmd", "_analysis.Rmd"))
clamour_list(path = ".", ignore = c("index.Rmd", "about.Rmd", "_analysis.Rmd"))
path |
Path to directory to search for |
ignore |
Vector or files to ignore |
Markdown string describing analysis files
Load tweets for a clamour analysis
clamour_load_tweets( query, cache_file = NULL, timezone = Sys.timezone(), fixed = FALSE )
clamour_load_tweets( query, cache_file = NULL, timezone = Sys.timezone(), fixed = FALSE )
query |
Query string to use for collecting new tweets. |
cache_file |
Path to an |
timezone |
Time zone associated with tweets. |
fixed |
If |
If a cache file exists tweets will first be read from here. New tweets will
also be downloaded if fixed = FALSE
. Cached and new tweets are combined and
only the most recent version of each tweet is kept. Additional datetime
,
date
and hour
fields are created using the supplied timezone
.
tibble containing tweets
Creates a new analysis file based on the clamour template.
clamour_new( name, hashtag, description = paste("An analysis of", hashtag), start_day = Sys.Date(), end_day = Sys.Date() + 1, timezone = Sys.timezone(), theme = "theme_light", accent = "dodgerblue", accent2 = NULL, kcore = 2, topics_k = 6, bigram_filter = 3, fixed = FALSE, seed = 1, dir = "analysis" )
clamour_new( name, hashtag, description = paste("An analysis of", hashtag), start_day = Sys.Date(), end_day = Sys.Date() + 1, timezone = Sys.timezone(), theme = "theme_light", accent = "dodgerblue", accent2 = NULL, kcore = 2, topics_k = 6, bigram_filter = 3, fixed = FALSE, seed = 1, dir = "analysis" )
name |
Name of the analysis. This is used to name files so should usually be short and simple. |
hashtag |
The hashtag to use for this analysis, starting with "#". Can also be a vector of hashtags. |
description |
A more detailed description of the analysis, details of the event etc. |
start_day |
First day to be included in the analysis. |
end_day |
Last day to be included in the analysis. |
timezone |
Timezone to be used for the analysis. |
theme |
Name of a ggplot2 theme function to use for plots. |
accent |
Accent colour to use for plots. |
accent2 |
Secondary accent colour to use for plots. If |
kcore |
k-core to use for filtering the mentions network. |
topics_k |
Number of topics to use for topic modelling. |
bigram_filter |
Number of co-occurrences for filtering the bigram graph. |
fixed |
Whether to continue to search and download new tweets. Set to
|
seed |
Random seed set at the start of analysis. |
dir |
Directory to save the new analysis file. |
Path to the newly created file, invisibly
This function creates the directory structure necessary for analysing Twitter hashtag activity and displaying the results on a website. It will also prompt you to install packages required by the default analysis and to authorise rtweet.
clamour_setup(path, rstudio = rstudioapi::isAvailable(), open = interactive())
clamour_setup(path, rstudio = rstudioapi::isAvailable(), open = interactive())
path |
A path for the project. If it exists it will be used. If it does exist it will be created, provided the parent path exists. |
rstudio |
If |
open |
If
|
Path to the newly created project, invisibly.
Based on usethis::create_package()
Read the YAML front matter from a set of clamour analysis files and produce a tidy data.frame.
clamour_table( path = ".", ignore = c("index.Rmd", "about.Rmd", "_analysis.Rmd") )
clamour_table( path = ".", ignore = c("index.Rmd", "about.Rmd", "_analysis.Rmd") )
path |
Path to directory to search for |
ignore |
Vector or files to ignore |
data.frame containing information on analysis files