

ame{count.rows} \alias{count.rows} \title{ Count \code{data.frame} rows } \description{ Counts the unique rows of a \code{data.frame} } \usage{ count.rows(x) } \arguments{ \item{x}{ Just a \code{data.frame} or \code{matrix} } } \details{ Basically, this function tries to be smart about counting rows. It relies on the \code{\link{order}} function and basic logic to do the heavy lifting. } \value{ A \code{data.frame} with a column named \code{counts}, all the olumns of \code{x} and the rows that would appear in \code{unique( x )}. } \author{ Charles C. Berry \email{ccberry@ucsd.tajo.edu } } \examples{ hec.frame <- as.data.frame( HairEyeColor ) hec.frame <- hec.frame[ rep(1:nrow(hec.frame), hec.frame$Freq ), ] hec.counts <- count.rows( hec.frame ) all.equal( hec.counts$counts, hec.counts$Freq ) hec.counts } \keyword{ manip }

#+begin_src Rd :eval nil :tangle man/count.rows.Rd

ame{count.rows} \alias{count.rows} \title{ Count \code{data.frame} rows } \description{ Counts the unique rows of a \code{data.frame} } \usage{ count.rows(x) } \arguments{ \item{x}{ Just a \code{data.frame} or \code{matrix} } } \details{ Basically, this function tries to be smart about counting rows. It relies on the \code{\link{order}} function and basic logic to do the heavy lifting. } \value{ A \code{data.frame} with a column named \code{counts}, all the olumns of \code{x} and the rows that would appear in \code{unique( x )}. } \author{ Charles C. Berry \email{ccberry@ucsd.tajo.edu } } \examples{ hec.frame <- as.data.frame( HairEyeColor ) hec.frame <- hec.frame[ rep(1:nrow(hec.frame), hec.frame$Freq ), ] hec.counts <- count.rows( hec.frame ) all.equal( hec.counts$counts, hec.counts$Freq ) hec.counts } \keyword{ manip } #+end_src