I am sorry if this question has been asked before, but could not find a solution to my problem. Which `apply`-like function fits the below case?

I have an `R` function which has 3 arguments `(x, y, z)`. What it does is basically to call an `PostgreSQL` function which quires `x, y, z` and retrieve a dataframe consisting of corresponding values `a, b, c`, something like this;

```
myfunc <- function(x, y, z){
  get.df <- fn$sqldf("SELECT * FROM retrieve_meta_data('$x', '$y', '$z')")
# get.df is a dataframe consisting of x number of rows and columns a, b, c
# some dataframe manipulation... 
  return(get.df)
}

```

What I am looking for is to call this function by using a dataframe `(call.df)` with x number of rows and columns `x, y, z`. So `apply` the function for each ith row and using the columns as arguments. 

I have looked through a range of `apply`-like functions but I have failed so far. It's probably way easy.

I imagine something like `apply(call.df, c(1,2), myfunc)` but this gives the error;

```
Error in eval(expr, envir, enclos) : 
argument "y" is missing, with no default

```

I hope am clear enough without supplying any dummy data. Any pointers would be very much appreciated, thanks!
['https://Stackoverflow.com/questions/21438650', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1734415/']
It's helpful if you supply sample data so you get an answer that matches your situation, but it sounds like you're looking for `mapply`, e.g.,

```
do.call(mapply, c(myfunc, call.df[c(x.col, y.col, z.col)]))

```
Just apply over `1` for your margin; then the row is passed to your function as a vector and you should be able to deal with it. For example:

```
> apply(iris, 1, function(v) paste(v["Species"], v["Sepal.Width"]))
[1] "setosa 3.5"     "setosa 3.0"     "setosa 3.2"     "setosa 3.1"
...

```