Skip to contents

conditionally apply a pipe

Usage

pipe_if(df, cond, func)

Arguments

df

dataframe to apply funct to if cond TRUE

cond

condition whether to run func, not vectorised (should be a single logical)

func

function to run

Examples

#data.frame(a=c(1:5)) |>
#   pipe_if(TRUE, \(d) d |>
#   mutate(b=a*2))