https://github.com/hadley/dplyr
Tip revision: a987a10cb29981145fd0f22d91a748369901b5be authored by Kirill Müller on 05 January 2016, 09:43:36 UTC
Merge branch 'release/0.1-3' into production
Merge branch 'release/0.1-3' into production
Tip revision: a987a10
tbl_df.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tbl-df.r
\name{tbl_df}
\alias{tbl_df}
\title{Create a data frame tbl.}
\usage{
tbl_df(data)
}
\arguments{
\item{data}{a data frame}
}
\description{
A data frame tbl wraps a local data frame. The main advantage to using
a \code{tbl_df} over a regular data frame is the printing:
tbl objects only print a few rows and all the columns that fit on one
screen, describing the rest of it as text.
}
\section{Methods}{
\code{tbl_df} implements four important base methods:
\describe{
\item{print}{Only prints the first 10 rows, and the columns that fit on
screen}
\item{\code{[}}{Never simplifies (drops), so always returns data.frame}
\item{\code{[[}, \code{$}}{Calls \code{\link{.subset2}} directly,
so is considerably faster. Throws error if column does not exist.}
}
}
\examples{
ds <- tbl_df(mtcars)
ds
as.data.frame(ds)
if (require("Lahman")) {
batting <- tbl_df(Batting)
dim(batting)
colnames(batting)
head(batting)
}
}