-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hello,
Today I had the need to do something similar:
passmissing(f) = x -> ismissing(x) ? missing : f(x)
f = passmissing(uppercase)
@chain dat begin
@mutate(COL_A = f(COL_A))
@distinct(COL_ID)
end
this is the version that works, but I've also tried:
@mutate(dat, COL_A = passmissing(!!uppercase)(COL_A))@mutate(dat, COL_A = passmissing(uppercase)(COL_A))@mutate(dat, COL_A = passmissing($uppercase)(COL_A))
but all three fail.
the first with a:
UndefVarError: passmissing($(Expr(:escape, :uppercase))) not defined in TidierData.
the second with
ArgumentError: column name :uppercase not found in the data frame
the third with
UndefVarError: passmissing($uppercase) not defined in TidierData.
Now, I'm definitely stumbling around, but I was wondering if
- there was a way of signaling that an identifier is a main module symbol and not a column name
- in a bit of XY-problem fashion, is there a blessed way of replicating the
passmissingfunctionality?skipmissingwill return columns that can be smaller, leading to all sort of issues in certain workflows.
kdpsingh
Metadata
Metadata
Assignees
Labels
No labels