With () function is used to apply an expression for a given dataset and BY () function is used for applying a function each level of factors.