Question: I'm currently building a food application which has users select a range of options (perishable, non-perishable ) and (snack, produce or meal) via a set of radio buttons. I'm currently using node.js and sqlite 3 to query a database to determine which entries to return to the user after they search the database. 

I want to write a query such that when the booleans from the client-side are sent over to the server, the server will choose the entries such that perishable if perishable is set to true on the client that the query will find just the perishable items and vice-versa. I also want the same functionality with 

Example:

```
perishable = request.perishable.
non-perishable = request.non-perishable
snack = request.non-perishable
meal = request.non-perishable
produce = request.non-perishable.

var q = 'SELECT * FROM posts WHERE available == true AND (if perishable is true all rows where the perishable column is set to true... etc );

```

Answer: 
How about (insert as many `row.names` as you want rows in the output `data.frame`):

```
data = data.frame(row.names = '1')
data[paste0('a', 1:10)] = .614
data[paste0('c', 1:10)] = -6.198
data[paste0('d', 1:10)] = 35.952

```

Or (column names won't be exactly right; thanks @Frank for simplifying my approach here)

```
data.frame(a = .641, c = -6.198, d = 35.052)[ , rep(1:3, each = 10)]

```
Do it all in one go:

```
n <- 10
setNames(
  data.frame(rep(list(0.641,-6.198,35.952), each=n)),
  paste0(rep(c("a","c","d"),each=n), seq_len(n))
)

```