Creates a SQL pivot query. Similar to the tidyr::gather
function.
1 | sql_unpivot(con, from, select, key, value, levels, order_by = NULL)
|
con |
a Database connection |
from |
the from clause |
select |
variables to select in addition to levels. |
key |
Variable columns originate from |
value |
The expression to evaluate to create the values |
levels |
the columns to turn into values of a variable. |
order_by |
optional order by clause |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.