-
Notifications
You must be signed in to change notification settings - Fork 283
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
I bet this will have the same roots as #629 & #639, but as these two only present compose
, I just wanted to share that partial
fails with S3 generics:
library(purrr)
packageVersion("purrr")
#> [1] '0.3.0'
map(airquality, mean)
#> $Ozone
#> [1] NA
#>
#> $Solar.R
#> [1] NA
#>
#> $Wind
#> [1] 9.957516
#>
#> $Temp
#> [1] 77.88235
#>
#> $Month
#> [1] 6.993464
#>
#> $Day
#> [1] 15.80392
p_mean <- partial(mean, na.rm = TRUE)
p_mean
#> <partialised>
#> function (...)
#> mean(na.rm = TRUE, ...)
map(airquality, p_mean)
#> Error in UseMethod("mean"): no applicable method for 'mean' applied to an object of class "c('integer', 'numeric')"
Created on 2019-02-24 by the reprex package (v0.2.1)
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior