EVOLUTION-MANAGER
Edit File: group_data.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: Grouping metadata</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 group_data {dplyr}"><tr><td>group_data {dplyr}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Grouping metadata</h2> <h3>Description</h3> <ul> <li> <p><code>group_data()</code> returns a data frame that defines the grouping structure. The columns give the values of the grouping variables. The last column, always called <code>.rows</code>, is a list of integer vectors that gives the location of the rows in each group. You can retrieve just the grouping data with <code>group_data()</code>, and just the locations with <code>group_rows()</code>. </p> </li> <li> <p><code>group_indices()</code> returns an integer vector the same length as <code>.data</code> that gives the group that each row belongs to (cf. <code>group_rows()</code> which returns the rows which each group contains). </p> </li> <li> <p><code>group_vars()</code> gives names of grouping variables as character vector; <code>groups()</code> gives the names as a list of symbols. </p> </li> <li> <p><code>group_size()</code> gives the size of each group, and <code>n_groups()</code> gives the total number of groups. </p> </li></ul> <p>See <a href="context.html">context</a> for equivalent functions that return values for the <em>current</em> group. </p> <h3>Usage</h3> <pre> group_data(.data) group_keys(.tbl, ...) group_rows(.data) group_indices(.data, ...) group_vars(x) groups(x) group_size(x) n_groups(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>.data, .tbl, x</code></td> <td> <p>A data frame or extension (like a tibble or grouped tibble).</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Use of <code>...</code> is now deprecated; please use <code>group_by()</code> first instead.</p> </td></tr> </table> <h3>Examples</h3> <pre> df <- tibble(x = c(1,1,2,2)) group_vars(df) group_rows(df) group_data(df) gf <- group_by(df, x) group_vars(gf) group_rows(gf) group_data(gf) </pre> <hr /><div style="text-align: center;">[Package <em>dplyr</em> version 1.0.2 <a href="00Index.html">Index</a>]</div> </body></html>