I want to replace `apply()`

(and it's derivatives) with a `purrr`

function.

I have a data.frame like this one:

```
> df
V1 V2 V3
1 NA 2 3
2 2 NA 3
3 3 3 NA
```

And I want to apply two functions rowwise: `min(x, na.rm = T)`

and `which.min(x)`

and return the results as a dataframe.

If I know how many columns there are I can do e.g. this:

```
pmap_dfr(df, function(V1, V2, V3) {data.frame(min = pmin(V1, V2, V3, na.rm = T),
where = which.min(c(V1, V2, V3)))})
min where
1 2 2
2 2 1
3 3 1
```

How can I make `pmap()`

or any other `purrr`

function take the whole row as argument just like `apply()`

does?

```
func <- function(x) {data.frame(min = min(x, na.rm = T), where = which.min(x))}
> Reduce(rbind, apply(df,1, func))
min where
V2 2 2
V1 2 1
V11 3 1
```

I probably just missed a feature or some trick. Thanks for your help.

Your solution will work for all columns if you use an ellipsis.