https://github.com/hadley/dplyr
Raw File
Tip revision: 681a3b3d84b2cf7f49e8212933866a8bde9acc13 authored by Kirill Müller on 07 January 2016, 09:45:19 UTC
Merge branch 'release/0.1-4' into production
Tip revision: 681a3b3
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)
}
}

back to top