nested_to_pipe function

Convert nested R code to pipe syntax