I am trying to create a function which returns the min & max value of a vector.

Currently I have created 2 seperate functions but I need the one to return similar output like so.
min max
-2.078793 2.041260

Vector

```
vec <- rnorm(20)

```

Functions

```
minmax <- function(x) {
  my_min = Inf
  for (i in seq_along(x)) {
    if (x[i] < my_min) my_min = x[i]
  }
  return(min = my_min)
}

minmax <- function(x) {
  my_max = 0
  for (i in seq_along(x)) {
    if (x[i] > my_max) my_max = x[i]
  }
  return(max = my_max)
}

```