Let’s say I have df = DataFrame(ax = 1:3, bx = 4:6, cy = 7:9, dy = 10:12)
and want to double the values of each column that has an “x” in its header, while leaving the columns that don’t have an “x” in their header unchanged. When I try to do that with
transform(df, r"x" => ByRow(x -> 2x); renamecols = false)
I get MethodError: no method matching (::Main.workspace4.var"#1#2")(::Int64, ::Int64)
. It looks like it’s trying to use them each as inputs to a single bivariate function, because the following code runs
transform(df, r"x" => ByRow(+))
I know I could select columns with regex and then apply the transformation to all of them, but that would leave the other columns out, which I don’t want.