EVOLUTION-MANAGER
Edit File: separate_rows.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Separate a collapsed column into multiple rows</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for separate_rows {tidyr}"><tr><td>separate_rows {tidyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Separate a collapsed column into multiple rows</h2> <h3>Description</h3> <p>If a variable contains observations with multiple delimited values, this separates the values and places each one in its own row. </p> <h3>Usage</h3> <pre> separate_rows(data, ..., sep = "[^[:alnum:].]+", convert = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>data</code></td> <td> <p>A data frame.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p><<code><a href="tidyr_tidy_select.html">tidy-select</a></code>> Columns to separate across multiple rows</p> </td></tr> <tr valign="top"><td><code>sep</code></td> <td> <p>Separator delimiting collapsed values.</p> </td></tr> <tr valign="top"><td><code>convert</code></td> <td> <p>If <code>TRUE</code> will automatically run <code><a href="../../utils/html/type.convert.html">type.convert()</a></code> on the key column. This is useful if the column types are actually numeric, integer, or logical.</p> </td></tr> </table> <h3>Examples</h3> <pre> df <- tibble( x = 1:3, y = c("a", "d,e,f", "g,h"), z = c("1", "2,3,4", "5,6") ) separate_rows(df, y, z, convert = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>tidyr</em> version 1.1.2 <a href="00Index.html">Index</a>]</div> </body></html>