Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Mutate doesn't work with set_units() #51

@vorpalvorpal

Description

@vorpalvorpal

The title says it all. See code below. Also, thanks for the great package. You have no idea how frustrating debugging pipes had been as a newbie until I discovered tidylog :)

library(tidyverse)
library(units)

df <- tribble(~A, ~B,
        1, 2,
        2, 3)

df %>%
  mutate(B = set_units(B , mg)) %>%
  print()
# A tibble: 2 x 2

library(tidylog)

df %>%
  mutate(B = set_units(B , mg)) %>%
  print() 
# Error in Ops.units(new, old) : 
#  both operands of the expression should be "units" objects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions