text: Q:
  
  How to pass several named parameters to a function with purrr?
  
  I have been trying to connect a pipe function with a normal function and set the return value to a new column. What I'm trying to do is to send the function the parameters and then continue chaining operations
  This is the function that I'm trying to run with purrr:
  fileDownloader<- function(url, path, log_attr){
      url <- as.character(url)
      path <- as.character(path)
      log_attr <- as.character(log_attr)
      res <- 0
      if (log_attr == "a"){
          text<-paste("Function invoked at ", as.character(Sys.time()), sep=" ")
          print(text)
          write.csv(text, file = "log.csv")
      }    
  
      if(!file.exists(path)){
          res <- tryCatch({                        
                          archivo <- curl_download(url=url, destfile=path)
                          res <-1
                      }
                      ,error=function(e){res <- -1}
                  )
      }
      res
  }
  
  I have this dataframe that I'm trying to pipe
  my_dataframe <- data.frame(
      url=c("www.google.com", "yahoo.com", "bing.com", NA),
      file_name=c("mi_file1.txt", "mi_file2.txt", "mi_file3.txt", NA),
      attributes=c("a", "", "", NA),
      another_col=c("xxx", "yyy", "zzz", "111")
      )
  
  This is the actual piping:
  my_dataframe %>%
      filter(!is.na(url)) %>%
      # mutate(file_status = pmap(list(.$url, .$file_name, .$attributes), .f=fileDownloader) )
      # prints 212/321/131
      # mutate(file_status = map(.$url, path=.$file_name, log_attr=.$attributes, .f=fileDownloader))
      # works only with the first element
  
  I have managed to "make it work" with {walk} but it does not return anything.
  Does anybody have an idea what I'm doing wrong?
  Thanks
  
  A:
  
  does this work for you:
  my_dataframe %>%
    filter(!is.na(url)) %>%
    mutate(file_status = pmap_chr(list(.$url, .$file_name, .$attributes), .f = fileDownloader))
  
  