magrittr's pipeable operator replacements
operator: x^y
functional alternative: x %>% raise_to_power(y)
# Define a harmonic acres to hectares function
harmonic_acres_to_hectares <- function(acres) {
acres %>%
# Get the reciprocal
raise_to_power(-1) %>%
# Convert acres to hectares
acres_to_hectares() %>%
# Get the reciprocal again
raise_to_power(-1)
}
I am curious why don't use 1/x directly?