Closed yahrMason closed 1 year ago
Try using R-style bang-bang interpolation, like this:
using Tidier
df = DataFrame(a = [1,2,3], b = [4,5,6])
@chain df begin
@mutate(c = b*10)
end
x = 10
@chain df begin
@mutate(c = b * !!x)
end
See here for an explanation: https://tidierorg.github.io/Tidier.jl/dev/examples/generated/UserGuide/interpolation/
Happy to answer questions. If this works, feel free to close this issue.
To your point, the detailed explanation for this is in the Interpolation docs and not the @mutate()
docs.
I think it's ok in Interpolation for now (just because it's a complex issue) but will consider bringing this issue up elsewhere in the docs as well to familiarize folks with this.
Ah! Thanks for this. Will close the issue.
I am sure there is a way to do this, but I am having trouble figuring it out. I am trying to reference a global variable within a mutate call, but I am getting an error that says
ERROR: ArgumentError: column name "x" not found in the data frame