Skip to content

Commit

Permalink
no longer importing dplyr. #24
Browse files Browse the repository at this point in the history
  • Loading branch information
romainfrancois committed Apr 14, 2018
1 parent 43f76e7 commit 02a5206
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 22 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Encoding: UTF-8
LazyData: true
Imports:
stringr,
dplyr,
glue (>= 1.2.0.9000),
crayon,
utils,
Expand All @@ -27,5 +26,7 @@ Imports:
RoxygenNote: 6.0.1.9000
URL: https://github.com/hadley/emo
BugReports: https://github.com/hadley/emo/issues
Suggests: testthat
Suggests:
testthat,
dplyr
Remotes: tidyverse/glue
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ export(moon)
export(square)
importFrom(assertthat,assert_that)
importFrom(crayon,silver)
importFrom(dplyr,filter)
importFrom(dplyr,slice)
importFrom(glue,glue)
importFrom(glue,glue_collapse)
importFrom(lubridate,ymd)
importFrom(magrittr,"%>%")
importFrom(purrr,map_chr)
importFrom(purrr,walk2)
importFrom(rlang,enquo)
Expand Down
3 changes: 1 addition & 2 deletions R/flag.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
#' }
#'
#' @importFrom stringr str_detect
#' @importFrom dplyr filter
#' @importFrom glue glue
#' @export
flag <- function( pattern ){
data <- filter( emo::jis, group == "Flags", str_detect(name, pattern) )
data <- emo::jis[ emo::jis$group == "Flags" & str_detect(emo::jis$name, pattern), ]
n <- nrow(data)
if( n == 0 ){
stop( glue( "Cannot find flag '{pattern}' ") )
Expand Down
9 changes: 3 additions & 6 deletions R/keycap.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,18 @@
#' }
#'
#' @importFrom assertthat assert_that
#' @importFrom magrittr %>%
#' @importFrom dplyr filter slice
#' @export
keycap <- function( x ){
choices <- c("#", "*", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10")
x <- as.character(x)
assert_that( length(x) == 1)
assert_that( x %in% choices )

idx <- which( x == choices )
data <- filter( emo::jis, subgroup == "keycap" ) %>%
slice(idx)
jis <- emo::jis
emoji <- jis$emoji[ jis$subgroup == "keycap" & jis$qualified == "fully-qualified" ][ x == choices]

structure(
data$emoji,
emoji,
char = x,
class = c("keycap", "emoji")
)
Expand Down
4 changes: 1 addition & 3 deletions R/medal.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ medal <- function( position ){
names <- c("1st place medal", "2nd place medal", "3rd place medal")

pos <- eval_tidy( position, data = aliases )

data <- emo::jis %>%
filter( name == names[pos] )
data <- emo::jis[ emo::jis$name == names[pos], ]

structure( data$emoji,
class = c("medal", "emoji"),
Expand Down
10 changes: 4 additions & 6 deletions R/moon.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ moon <- function( date, day = day_in_synodic_cycle(date) ){
assert_that( day >= 0 & day <= synodic_month )

idx <- 1 + (day / synodic_month * 8) %% 8

data <- emo::jis %>%
filter( str_detect( name, "moon$" ) ) %>%
slice(idx)

structure( data$emoji,
jis <- emo::jis
data <- jis[ which(str_detect( jis$name, "moon$" ))[idx], ]
structure(
data$emoji,
class = c("moon", "emoji"),
day = day,
data = data
Expand Down

0 comments on commit 02a5206

Please sign in to comment.