Skip to content

Commit

Permalink
Remove magrittr dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
andrie committed Dec 25, 2017
1 parent 9105414 commit 2bbfa5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ SystemRequirements: Imports the `curl` and `XML` packages. These have system
Imports:
graphics,
httr,
magrittr,
methods,
stats,
tools,
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ importFrom(igraph,V)
importFrom(igraph,get.edge.attribute)
importFrom(igraph,graph.data.frame)
importFrom(igraph,plot.igraph)
importFrom(magrittr,'%>%')
importFrom(methods,is)
importFrom(stats,reshape)
importFrom(stats,setNames)
Expand Down
24 changes: 13 additions & 11 deletions R/addPackages.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ addOldPackage <- function(pkgs = NULL, path = NULL, vers = NULL,
#' @rdname listFiles
#' @docType methods
#'
#' @importFrom magrittr '%>%'
#'
#' @examples
#' \dontrun{
#' .listFiles('path/to/my/packages', type = "source")
Expand All @@ -204,15 +202,19 @@ addOldPackage <- function(pkgs = NULL, path = NULL, vers = NULL,

if (length(f)) {
# if multiple versions present, always use latest
fp <- strsplit(f, "_") %>%
sapply(., `[[`, 1)

fv <- strsplit(f, "_") %>%
sapply(., `[[`, 2) %>%
strsplit(., pattern) %>%
sapply(., `[[`, 1) %>%
as.numeric_version()

fp <- local({
x <- strsplit(f, "_")
sapply(x, `[[`, 1)
})

fv <- local({
x <- strsplit(f, "_")
x <- sapply(x, `[[`, 2)
x <- strsplit(x, pattern)
x <- sapply(x, `[[`, 1)
as.numeric_version(x)
})

fout <- sapply(fp, function(x) {
ids.p <- which(fp %in% x)

Expand Down

0 comments on commit 2bbfa5b

Please sign in to comment.