Skip to content

Commit c8ba5c7

Browse files
author
Youzhi Yu
committed
updated functions
1 parent efbaa48 commit c8ba5c7

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

R/emoji-categorize.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ emoji_category_add <- function(emoji_unicodes, emoji_category, tweet_tbl, tweet_
3535

3636
emoji_categorize <- function(tweet_tbl, tweet_text) {
3737

38-
emoji_long <- purrr::map2_dfr(tidyEmoji::category_unicode_crosswalk$unicodes,
39-
tidyEmoji::category_unicode_crosswalk$category,
40-
emoji_category_add,
41-
tweet_tbl,
42-
{{ tweet_text }})
38+
emoji_long <- purrr::map2_dfr(category_unicode_crosswalk$unicodes,
39+
category_unicode_crosswalk$category,
40+
emoji_category_add,
41+
tweet_tbl,
42+
{{ tweet_text }})
4343

4444
emoji_category_vector <- unique(emoji_long$.emoji_category)
4545

R/emoji-extraction.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
emoji_extract_unnest <- function(tweet_tbl, tweet_text){
2828
tweet_tbl %>%
29-
tidyEmoji::emoji_extract_nest({{ tweet_text }}) %>%
29+
emoji_extract_nest({{ tweet_text }}) %>%
3030
dplyr::select({{ tweet_text }}, .emoji_unicode) %>%
3131
dplyr::mutate(row_number = dplyr::row_number()) %>%
3232
tidyr::unnest(.emoji_unicode) %>%

R/tidyEmoji.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
#' @import utils
88
NULL
99

10-
## quiets concerns of R CMD check re: the .'s that appear in pipelines
10+
1111
if(getRversion() >= "2.15.1") utils::globalVariables(c(".",
1212
"name",
1313
"emoji_name",
1414
"unicode",
1515
"emoji_category",
16+
"emoji_unicode_crosswalk",
17+
"category_unicode_crosswalk",
1618
".emoji_category",
1719
".emoji_unicode",
1820
".emoji_unicode"))

R/top-n-emojis.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@
3232

3333
top_n_emojis <- function(tweet_tbl, tweet_text, n = 20, duplicated_unicode = "no"){
3434

35-
emoji_tbl <- tidyEmoji::emoji_tweets(tweet_tbl, {{ tweet_text }})
35+
emoji_tbl <- emoji_tweets(tweet_tbl, {{ tweet_text }})
3636

37-
emoji_count_list <- purrr::map(tidyEmoji::emoji_unicode_crosswalk$unicode,
37+
emoji_count_list <- purrr::map(emoji_unicode_crosswalk$unicode,
3838
.f = count_each_emoji,
3939
emoji_tbl,
4040
{{ tweet_text }})
4141

42-
tbl <- tibble::tibble(unicode = tidyEmoji::emoji_unicode_crosswalk$unicode,
42+
tbl <- tibble::tibble(unicode = emoji_unicode_crosswalk$unicode,
4343
emoji_count = unlist(emoji_count_list)) %>%
44-
dplyr::inner_join(tidyEmoji::emoji_unicode_crosswalk, by = "unicode") %>%
44+
dplyr::inner_join(emoji_unicode_crosswalk, by = "unicode") %>%
4545
dplyr::distinct() %>%
4646
dplyr::count(emoji_name, unicode, emoji_category, wt = emoji_count, sort = T)
4747

0 commit comments

Comments
 (0)