Skip to content

Commit

Permalink
resubmission to cran
Browse files Browse the repository at this point in the history
  • Loading branch information
abuchmueller committed Oct 26, 2021
1 parent 24ea598 commit 3d712a3
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
^\.travis\.yml$
^\.github$
^LICENSE\.md$
^cran-comments\.md$
^CRAN-RELEASE$
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2021-10-26.
Once it is accepted, delete this file and tag the release (commit 24ea598).
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Package: Twitmo
Type: Package
Title: Twitter Topic Modeling and Visualization for R
Version: 0.1.0
Version: 0.1.1
Author: Andreas Buchmueller
Maintainer: Andreas Buchmueller <a.buchmueller@stud.uni-goettingen.de>
Description: Tailored for topic modeling with tweets and fit for visualization tasks in R.
Collect, pre-process and analyze the contents of tweets using
LDA and STM models. Comes with visualizing capabilities like tweet and hashtag maps
and built-in support for LDAvis.
and built-in support for 'LDAvis'.
License: MIT + file LICENSE
URL: https://github.com/abuchmueller/Twitmo
BugReports: https://github.com/abuchmueller/Twitmo/issues
Expand Down
1 change: 1 addition & 0 deletions R/parse_tweets.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @usage load_tweets(file_name)
#' @param file_name Character string. Name of JSON file with data collected by
#' \link[rtweet]{stream_tweets} or \code{get_tweets()}.
#' @return A data frame of tweets data with additional meta data
#'
#' @seealso \link[rtweet]{parse_stream}, \link[jsonlite]{stream_in}, \link[rtweet]{tweets_with_users}
#' @export
Expand Down
10 changes: 9 additions & 1 deletion R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ plot_tweets <- function(data, region = ".", alpha = 0.01, ...) {
# remove opacity if sample size is small
if (nrow(data) < 100) alpha <- 1

# restore user options on exit
oldpar <- graphics::par(no.readonly = TRUE)
on.exit(graphics::par(oldpar))

## plot state boundaries
graphics::par(mar = c(0, 0, 3, 0))
maps::map("world", region, ...)
Expand Down Expand Up @@ -64,7 +68,7 @@ plot_tweets <- function(data, region = ".", alpha = 0.01, ...) {
#'
#' # Plot tweets on mainland USA region
#' plot_hashtag(mytweets,
#' region = region = "USA(?!:Alaska|:Hawaii)",
#' region = "USA(?!:Alaska|:Hawaii)",
#' hashtag = "breakfast",
#' ignore_case=TRUE,
#' alpha=1)
Expand All @@ -82,6 +86,10 @@ plot_hashtag <- function(data, region = ".", alpha = 0.01, hashtag = "", ignore_
# remove opacity if sample size is small
if (nrow(data[which(sapply(data$hashtags, FUN=function(X) hashtag %in% X)), ]) < 100) alpha <- 1

# restore user options on exit
oldpar <- graphics::par(no.readonly = TRUE)
on.exit(graphics::par(oldpar))

## plot state boundaries
graphics::par(mar = c(0, 0, 3, 0))
maps::map("world", region, ...)
Expand Down
14 changes: 14 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## Resubmission
This is a resubmission. In this version I have:

* Written package names, software names and API names in single quotes in title and description.

* Added missing \value to load_tweets.Rd describing the output.

* Fixed unexecutable code in man/plot_hashtag.Rd.

* Added on.exit() calls to `plot_hashtag` and `plot_tweets` functions in plots.R to ensure users options are not changed by function calls to those functions.

## R CMD check results
There were no ERRORs, WARNINGs or NOTEs.

3 changes: 3 additions & 0 deletions man/load_tweets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plot_hashtag.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d712a3

Please sign in to comment.