Description Usage Arguments Value Details
Reshape the union or birth history from wide to long format and back.
1 | wfs_reshape(data, direction, history, drop = TRUE)
|
data |
Required data frame based on a WFS standard recode file |
direction |
Required string set to "long" or "wide" |
history |
Required string set to "unions" or "births" |
drop |
Optional boolean indicating whether to drop empty entries |
A reshaped data frame with attributes
wfs_reshape
relies on R's reshape
to do the work,
generating the appropriate function call to go from wide to long format.
Note that all history variables must have been extracted, usually by
specifying the unions
or births
keyword.
Typically you will first reshape in the "long" direction to create
one record per union or per birth. By default the function keeps only
actual entries in the history, but setting drop = FALSE
will keep
them all.
If you reshape back to "wide" format we rely on the fact that R's
reshape
is reversible, checking only that the dataset is in the
appropriate long format. By default the restored file will have only
ever-married women or mothers unless empty entries were retained.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.