File tree Expand file tree Collapse file tree 3 files changed +62
-3
lines changed
Expand file tree Collapse file tree 3 files changed +62
-3
lines changed Original file line number Diff line number Diff line change 11Package: tidyEmoji
22Type: Package
3- Title: Detects Emoji on Text
3+ Title: Discovers Emoji from Text
44Version: 0.1.0
55Author: Youzhi Yu
66Maintainer: Youzhi Yu <
[email protected] >
77Description: Unicodes are not friendly to work with, and not all Unicodes are
8- Emoji per se, making obtaining Emoji statistics a not-so-easy task. This
9- tool can help your experience of working with Emoji as smooth as possible.
8+ Emoji per se, making obtaining Emoji statistics a difficult task. This
9+ tool can help your experience of working with Emoji as smooth as possible,
10+ as it has the tidyverse style.
1011License: GPL (>= 3)
1112Encoding: UTF-8
1213LazyData: true
1314RoxygenNote: 7.1.2
15+ Depends:
16+ R (>= 3.5.0)
1417Imports:
1518 dplyr,
1619 emoji,
@@ -19,3 +22,6 @@ Imports:
1922 tibble,
2023 tidyr,
2124 utils
25+ Suggests:
26+ testthat (>= 3.0.0)
27+ Config/testthat/edition: 3
Original file line number Diff line number Diff line change 1+ library(testthat )
2+ library(tidyEmoji )
3+
4+ test_check(" tidyEmoji" )
Original file line number Diff line number Diff line change 1+ library(dplyr )
2+
3+ df <- data.frame (tweets = c(" I love tidyverse \U 0001f600\U 0001f603\U 0001f603" ,
4+ " R is my language! \U 0001f601\U 0001f606\U 0001f605" ,
5+ " This Tweet does not have Emoji!" ,
6+ " Wearing a mask\U 0001f637\U 0001f637\U 0001f637." ,
7+ " Emoji does not appear in all Tweets" ))
8+
9+
10+ test_that(" emoji_summary dimension" , {
11+
12+ expect_equal(
13+ df %> %
14+ emoji_summary(tweets ) %> %
15+ pull(emoji_tweets ),
16+ 3
17+ )
18+
19+ expect_equal(
20+ df %> %
21+ emoji_summary(tweets ) %> %
22+ pull(total_tweets ),
23+ 5
24+ )
25+ })
26+
27+
28+ test_that(" emoji_tweets dimension" , {
29+ expect_equal(
30+ df %> %
31+ emoji_tweets(tweets ) %> %
32+ dim() %> %
33+ . [1 ],
34+ 3
35+ )
36+ })
37+
38+
39+
40+ test_that(" top_n_emojis emoji names" , {
41+ expect_identical(
42+ df %> %
43+ top_n_emojis(tweets , n = 1 ) %> %
44+ pull(emoji_name ),
45+ " face_with_medical_mask"
46+ )
47+ })
48+
49+
You can’t perform that action at this time.
0 commit comments