Skip to content

Commit

Permalink
remove plyr dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
fawda123 committed Mar 25, 2024
1 parent ddbcb0d commit e39dca7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Imports:
googleway,
httr,
magrittr,
plyr,
prettymapr,
RCurl,
rvest,
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,4 @@ import(xml2)
importFrom(dplyr,filter)
importFrom(dplyr,mutate)
importFrom(magrittr,"%>%")
importFrom(plyr,ldply)
importFrom(utils,data)
6 changes: 2 additions & 4 deletions R/compile_activities.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
#'
#' @details each activity has a value for every column present across all activities, with NAs populating empty values
#'
#' @importFrom plyr ldply
#'
#' @concept token
#'
#' @seealso \code{\link{compile_club_activities}} for compiling an activities list for club activities
Expand Down Expand Up @@ -62,8 +60,8 @@ compile_activities <- function(actlist, acts = NULL, id = NULL, units = 'metric'
actlist <- actlist[acts]
temp <- unlist(actlist)
att <- unique(attributes(temp)$names)
out <- ldply(actlist, compile_activity, columns = att)

out <- purrr::map_dfr(actlist, compile_activity, columns = att)
# convert relevant columns to numeric
cols <- c('id', 'achievement_count', 'athlete.resource_state', 'athlete_count', 'average_speed', 'average_watts', 'comment_count', 'distance', 'elapsed_time', 'elev_high', 'elev_low', 'end_latlng1', 'end_latlng2', 'kilojoules', 'kudos_count', 'map.resource_state', 'max_speed', 'moving_time', 'photo_count', 'resource_state', 'start_latitude', 'start_latlng1', 'start_latlng2', 'start_longitude', 'total_elevation_gain', 'total_photo_count')
cols <- names(out)[names(out) %in% cols]
Expand Down

0 comments on commit e39dca7

Please sign in to comment.