Python Lambda If Function In Rstudio