Question: I've seen a few other questions similar to mine (this [Puppeteer unable to run on heroku](https://stackoverflow.com/questions/52225461/puppeteer-unable-to-run-on-heroku) was helpful) but it doesn't quite solve my problem. I'm using the Markup's Blacklight npm package in a site of mine running on Heroku. When running locally it works perfectly, but on Heroku it doesn't work because a function in that package is what calls Puppeteer so I cannot add these arguments, although I know `'--no-sandbox'` is an arg.

```
const browser = await puppeteer.launch({
  args: [
    '--no-sandbox',
    '--disable-setuid-sandbox',
  ],
});

```

I'm not getting any outright failures, but it tells me my `browser = null` and I know the data produced is empty.

Answer: 
Try this:

```
library(dplyr)
dt <- dt %>% rowwise() %>% mutate(z = paste(min(x,y),max(x,y),sep="_"))

```
We can use `pmin/pmap` (which is vectorized and is very efficient) to sort elementwise and then `paste` to create the new variable 'Z' in `base R`

```
df1$Z <- with(df1, paste(pmin(X, Y), pmax(X, Y), sep="_"))

```

---

Another efficient option is `dapply` from `collapse` to loop over the rows (`MARGIN = 1`), then `sort` by row and `paste` the elements

```
library(collapse)
df1$Z <-  dapply(df1, function(x) paste(sort(x), collapse="_"), MARGIN = 1)

```

---

Or using `apply` from `base R`

```
df1$Z <- apply(df1, 1, function(x) paste(sort(x), collapse="_"))

```

### data

```
df1 <- structure(list(X = c(100L, 200L, 300L),
   Y = c(101L, 199L, 301L
)), class = "data.frame", row.names = c(NA, -3L))

```