EVOLUTION-MANAGER
Edit File: enframe.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: Converting vectors to data frames, and vice versa</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 enframe {tibble}"><tr><td>enframe {tibble}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Converting vectors to data frames, and vice versa</h2> <h3>Description</h3> <p><code>enframe()</code> converts named atomic vectors or lists to one- or two-column data frames. For a list, the result will be a nested tibble with a column of type <code>list</code>. For unnamed vectors, the natural sequence is used as name column. </p> <p><code>deframe()</code> converts two-column data frames to a named vector or list, using the first column as name and the second column as value. If the input has only one column, an unnamed vector is returned. </p> <h3>Usage</h3> <pre> enframe(x, name = "name", value = "value") deframe(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A vector (for <code>enframe()</code>) or a data frame with one or two columns (for <code>deframe()</code>).</p> </td></tr> <tr valign="top"><td><code>name, value</code></td> <td> <p>Names of the columns that store the names and values. If <code>name</code> is <code>NULL</code>, a one-column tibble is returned; <code>value</code> cannot be <code>NULL</code>.</p> </td></tr> </table> <h3>Value</h3> <p>For <code>enframe()</code>, a <a href="tibble.html">tibble</a> with two columns (if <code>name</code> is not <code>NULL</code>, the default) or one column (otherwise). </p> <p>For <code>deframe()</code>, a vector (named or unnamed). </p> <h3>Examples</h3> <pre> enframe(1:3) enframe(c(a = 5, b = 7)) enframe(list(one = 1, two = 2:3, three = 4:6)) deframe(enframe(3:1)) deframe(tibble(a = 1:3)) deframe(tibble(a = as.list(1:3))) </pre> <hr /><div style="text-align: center;">[Package <em>tibble</em> version 3.1.8 <a href="00Index.html">Index</a>]</div> </body></html>