| dcastSe | R Documentation |
data.table's dcast() transforms from long to wide format. It lacks a standard-evalutation interface for programming, and dcastSe() is an attempt to fill that gap, still using data.table::dcast() to perform the operation.
dcastSe(data, l, r, as.fun, ...)
data |
data set to transpose (widen) |
l |
left-hand side variables as character vector. Result will be long/vertical in these variables. |
r |
left-hand side variables as character vector. Result will be wide in these variables. |
as.fun |
An optional function to convert results with. If 'data' is a 'data.table', the default is to return a 'data.table', and if not the default is to return a 'data.frame'. |
... |
Additional arguments passed to 'data.table::dcast()'. |
Only two of l, r, and value.var are needed (see ?data.table::dcast for value.var), and the others will be derived. However, if value.var is a function, both l and r are needed.
a data.table
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.