Subset tibble with"0" for row index (
new_tibble() andas_tibble() supportattributes named"n" and"x" (#1573,#1574).
Support new vctrs.name_repair options:unique_quiet,universal_quiet (
Reworkview() to better work with RStudio andPositron (
as_tibble() callsas.data.frame() forobjects that are not subclasses of"tbl_df" (
Update comparison between tibble and data.frame (
Use pak for installing dev version in README (
Document that... must be empty inprint.tbl_df().
Request to not editNEWS.md.
Fix rendering if suggested packages are missing.
Alt text (
Skip tests if packages are missing.
Override:: to avoid failures in tests withoutsuggested packages.
.Call().Accurate location of the source of an error in error messages(#1379, #1065, #1508).
as_data_frame() now also refers toas.data.frame() in its deprecation message (#1149,#1506).
Deprecated functions and arguments where we could not detectusage by other CRAN packages (#1515):
data_frame_(),lst_(),frame_data()
as_tibble(validate = ),as_tibble(NULL),new_tibble(subclass = )
add_row() andadd_column() fornon-data-frame input
add_column() for input with non-uniquenames
corner cases fortbl[[x]]
Breaking change: Removeknit_print.trunc_mat()method (#1516).
Forwardtrunc_mat() to new-style pillar methods(#1517).
glue() and other classed characters forsubassignment (#1150, #1503).Newvignette("extending") (#275, #1512).
Minor updates (#1151, #1070, #1512, #1485).
Update example fornrow argument tonew_tibble() (
Fix display of mermaid diagrams invignette("formats") (
Remove ANSI escapes from invariants article on pkgdown(#1374).
Require vctrs >= 0.4.1 and pillar >= 1.8.1
Use cli for formatting conditions (#1387).
Usevec_as_location(missing = "error") for bettererror messages (#741, #1511).
Remove compatibility code for RSDA package which is broken anywaydue to other changes (#923, #1509).
Skip tests if suggested packages not available (#1246,
Remove obsolete tests (#1513).
Better reporting for error calls fromvec_as_location() (#1237).
Mentionmedian() in Recovery section ofvignette("numbers") (#1197).
trunc_mat() now returns a value with a differentstructure. This is considered an implementation detail that can changein the future, do not rely on it. The only guarantee is that callingprint() will display the input like a tibble (#1059).dim_desc() in reexports.class over.subclass inrlang::error_cnd() (#1015, #1060).set_num_opts() andset_char_opts() arereexported from pillar (#959).view() usesrlang::expr_deparse(width = Inf) to avoid errors with long|> pipes (#957).new_tibble() checks that thenrow argumentis nonnegative and less than 2^31 (#916).tbl_sum.tbl_df() has an ellipsis in its formals forextensibility."tibble.view_max" option forlazy tables (#954).as.data.frame.tbl_df() strips inner column names(#837).new_tibble() allows omitting thenrowargument again (#781).vignette("digits"),vignette("numbers"),?num and?char from the pillar package here (#913).iris bytrees (#943).?tibble_options help page (#912).x[i, j] <- one_row_value avoids explicit recyclingof the right-hand side, the recycling happens implicitly invctrs::vec_assign() for performance (#922).new_tibble() usesvctrs::new_data_frame()internally (#726,tbl[row, col] <- rhs treats an all-NAlogical vector as a missing value both for existing data (#773) and forthe right-hand side value (#868). This means that a column initializedwithNA (of typelogical) will change its typewhen a row is updated to a value of a different type.[[<-() supports symbols (#893).as_tibble_row() supports arbitrary vectors (#797).enframe() anddeframe() support arbitraryvectors (#730).tibble() andtibble_row() ignore allcolumns that evaluate toNULL, not only those where averbatimNULL is passed (#895, #900).new_tibble() is now faster (#901,pillar::dim_desc() (#859).num() andchar() are reexported frompillar (#880).tribble() andframe_matrix() give an errorif values are named (#871,cli.num_colors option (#410).new_tibble() examples for compatibility with pillar1.6.0.has_rownames() now works correctly for data frameswith a"row.names" attribute malformed due to a problem instructure() (#852).
tbl[FALSE, "column"] <- x adds new column again(#846).
Importing pillar 1.5.0, cli and crayon are now suggested packages(#475).
size_sum() is now reexported from pillar (#850,@topepo).
as_tibble() hints more often to use the.name_repair argument if column names are invalid(#855).
as_tibble.table() mentions.name_repairargument in the error message (#839).
Remove compatibility code for pillar < 1.5.0 (#861).
Moved most functions to the “stable” lifecycle (#860).
vec_ptype_abbr.tbl_df() andtype_sum.tbl_df() now uses the name of the topmost classfor subclasses of"tbl_df" (#843).formats.Rmd vignette.Establish compatibility with upcoming pillar 1.5.0(#818).
tbl_sum() shows “data frame” instead of “tibble” forobjects inheriting from"tbl" but not"tbl_df"(#818).
Registerformat.tbl() andprint.tbl()methods only if pillar doesn’t (#816).
Usevctrs::num_as_location() internally for subsetassignment of rows and columns for better error messages(#746).
Adapt tests to the development version of testthat.
Fix documentation link tobase::Extract.
add_row(df) adds an empty row again (#809,
Fix test compatibility with rlang 0.4.7.
Fix warning aboutneeds_dots arguments with pillar>= 1.4.5 (#798).
[[ works with classed indexes again, e.g. createdwithglue::glue() (#778).
add_column() works without warning for 0-column dataframes (#786).
tribble() now better handles named inputs (#775) andobjects of non-vtrs classes likelubridate::Period (#784)andformattable::formattable (#785).
Subsetting and subassignment are faster (#780, #790,#794).
is.null() is preferred overis_null()for speed.
Implement continuous benchmarking (#793).
is_vector_s3() is no longer reexported from pillar(#789).[<-.tbl_df() coerces matrices to data frames(#762).
Use delayed import for cli to work around unload problems indownstream packages (#754).
More soft-deprecation warnings are actually visible.
If.name_repair is a function, no repair messagesare shown (#763).
Remove superseded signal foras_tibble.list(),becauseas_tibble_row() only works for size 1.
as_tibble(validate = ) now always triggers adeprecation warning.
Subsetting and subassignment of rows with one-column matriceswork again, with a deprecation warning (#760).
Attempts to update a tibble row with an atomic vector give aclearer error message. Recycling message for subassignment appears onlyif target size is != 1.
Tweak title of “Invariants” vignette.
Subset assignment (“subassignment”) and also subsetting hasbecome stricter. Symptoms:
Error: No common type for …
Error: Assigned data... must be compatible with…
i must have one dimension, not 2
Error: Lossy cast from … to …
The “invariants” article athttps://tibble.tidyverse.org/dev/articles/invariants.html describes theinvariants that the operations follow in tibble, and the most importantdifferences to data frames. We tried to make subsetting andsubassignment as safe as possible, so that errors are caught early on,while introducing as little friction as possible.
List classes are no longer automatically treated as vectors.Symptoms:
Error: All columns in a tibble must be vectors
Error: Expected a vector, not a... object
If you implement a class that wraps a list as S3 vector, you need toinclude"list" in the class:
structure(x,class =c("your_s3_class","list"))Alternatively, implement avec_proxy() method asdescribed in https://vctrs.r-lib.org/reference/vec_data.html, orconstruct your class withlist_of().
Added experimental support for inner names for all columns, ofthe formtibble(a = c(b = 1)). Inner names are no longerstripped when creating a tibble. They are maintained for slicingoperations but not yet updated when assigning with a row subscript. Thisis a change that may break existing comparison tests that don’t expectnames in columns (#630). Symptoms:
tibble() now splices anonymous data frames,tibble(tibble(a = 1), b = a) is equivalent totibble(a = 1, b = a). This means thattibble(trees) now has three columns, usetibble(trees = trees) if the intention is to create apacked data frame (#581).
Thename-repair help topic is gone, refer to?vctrs::vec_as_names instead.
expression() columns are converted to lists as aworkaround for lacking support in vctrs (#657).
tribble() is now stricter when combining values. Allvalues in a column must be compatible, otherwise an error occurs (#204).The criteria for wrapping in a list column are now based on vctrsprinciples: non-vectors or vectors withvctrs::vec_size()unequal 1 are wrapped in lists.
$ warns unconditionally if column not found,[[ doesn’t warn.
add_row() now usesvctrs::vec_rbind()under the hood, this means that all columns are combined withvctrs::vec_c(). In particular, factor columns will beconverted to character if one of the columns is a charactercolumn.
Soft-deprecatesubclass argument tonew_tibble().
Soft-deprecateas_tibble() without arguments(#683).
Preparing to moveglimpse() andtbl_sum() to the pillar package. If your package implementsthese methods, please import the generics from pillar as soon as theybecome available there.
Internals now make heavy use of the vctrs package, following mostof the invariants defined there. Name repair is the responsibility ofvctrs now (#464).
All errors emitted directly by the package inherit from the"tibble_error" and"rlang_error" classes. Insome cases,"vctrs_error" errors may be passed through. Theexact subclass is subject to change.
Example:tibble(a = quote(b)) raises an error thatinherits from"tibble_error_column_must_be_vector","tibble_error" and"rlang_error", and from"error" and"condition" like all errors. Donot rely on the wording of"tibble_error_column_must_be_vector", this is likely tochange.
Use the following pattern to catch errors emitted by tibble:
tryCatch(your_code(),tibble_error =function(cnd) { })Newtibble_row() constructs tibbles that haveexactly one row, or fails. Non-vector objects are automatically wrappedin a list, vectors (including lists) must have length one(#205).
Newas_tibble_row() andas_tibble_col()convert a bare vector to a one-row or one-column tibble, respectively.as_tibble_col() also works for non-bare vectors. Usingas_tibble() for bare vectors is superseded (#447).
as_tibble.data.frame() uses implicit row names ifasked to create a column from row names. This allows lossless directconversion of matrices with row names to tibbles (#567,
Implementstr.tbl_df() (#480).
tribble() now returns columns with"unspecified" type for 0-row tibbles.
add_row() andadd_column() now restoreattributes to avoid errors when appending to sf objects or other tibblesubclasses (#662).
add_column() gains.name_repairargument. If not given,.data must have unique columns,with a deprecation message.
AllowPOSIXlt columns, they are now better supportedby dplyr and other tools thanks to vctrs (#626).
tibble() ignores NULL arguments, named or unnamed(#580).
view() works for remote data sources by applying thesame strategy asprint() andglimpse(). Themaximum number of rows in this case can be specified using the newn argument, by default it is taken from the new"tibble.view_max" option (#695).
Formatting dimensions never uses scientific notation.
glimpse() uses “Rows” and “Columns” instead of“Variables” and “Observations”, because we’re not sure if the data istidy here (#614).
view() now uses the created (or passed) titleargument (#610,
Import lifecycle package (#669).
new_tibble() removes redundant subclasses from the"class" attribute.
Using classed conditions. All classes start with"tibble_error_" and also contain"tibble_error" (#659).
The magrittr pipe%>% is reexported.
Relax version requirements.
Fix test failing after pillar upgrade.
Three dots are used even for"unique" name repair(#566).
add_row(),add_case() andadd_column() now signal a warning once per session if theinput is not a data frame (#575).
Fixview() for the case when an object namedx exists in the global environment (#579).
tibble names can again be set toNULL withinRStudio, as some R routines within RStudio relied on this behaviour(#563,
as_tibble.matrix(validate = TRUE) works again, witha lifecycle warning (#558).
Replacenew_list_along() byrep_along()to support rlang 0.3.1 (#557,
Thetibble() andas_tibble() functions, andthe low-levelnew_tibble() constructor, have undergone amajor overhaul to improve consistency. We suspect that package code willbe affected more than analysis code.
To improve compatibility with existing code, breaking changes werereduced to a minimum and in some cases replaced with a warning thatappears once per session. Calltibble:::scoped_lifecycle_errors() when updating yourpackages or scripts to the new semantics API to turn these warnings intoerrors. The compatibility code will be removed in tibble 3.0.0.
All optional arguments have moved past the ellipsis, and must bespecified as named arguments. This affects mostly thenargument toas_tibble.table(), passingnunnamed still works (with a warning).
new_tibble() has been optimized for performance, thefunction no longer strips dimensions from 1d arrays and no longer checkscorrectness of names or column lengths. (It still checks if the objectis named, except for zero-length input.) Use the newvalidate_tibble() if you need these checks (#471).
Thenrow argument tonew_tibble() isnow mandatory. Theclass argument replaces the nowdeprecatedsubclass argument, the latter will be supportedquietly for some time (#518).
Setting names on a tibble vianames(df) <- ...now also requires minimal names, otherwise a warning is issued once persession (#466).
Inas_tibble(), checking names is also enabled bydefault, even for tibbles, matrices and other matrix-like objects: namesmust exist,NA names are not allowed. Coercing a matrixwithout column names will trigger a warning once per session. (Thiscorresponds to the"minimal" checks describedbelow.).
Thevalidate argument toas_tibble()has been deprecated, see below for alternatives. (Theas_tibble.tbl_df() method has been removed, theas_tibble.data.frame() method will be used fortibbles.)
as_tibble() always checks that all columns are 1D or2D vectors and not of typePOSIXlt, even withvalidate = FALSE (which is now deprecated).
Callingas_tibble() on a vector now warns once persession. Useenframe(name = NULL) for converting a vectorto a one-column tibble, orenframe() for converting a namedvector to a two-column tibble.
data_frame() andframe_data() aresoft-deprecated, please usetibble() ortribble() (#111).
tibble_(),data_frame_(), andlst_() are soft-deprecated. Please usetibble() orlst() (#111, #509).
as.tibble() andas_data_frame() areofficially deprecated and not generic anymore, please use/implementas_tibble() (#111).
as_tibble.data.frame() (and alsoas_tibble.matrix()) strip row names by default. Code thatrelies on tibbles keeping row names now will see:
rownames() orrow.names(),NA values when subsetting rows with with acharacter vector,e.g. as_tibble(mtcars)["Mazda RX4", ].Callpkgconfig::set_config("tibble::rownames", NA) torevert to the old behavior of keeping row names. Packages that importtibble can callset_config() in their.onLoad() function (#114).
as_tibble() drops extra classes, in particularas_tibble.grouped_df() now removes grouping(#535).
column_to_rownames() now always coerces to a dataframe, because row names are no longer supported in tibbles(#114).
In all*_rownames() functions, the first argumenthas been renamed to.data for consistency (#412).
Subsetting one row with[..., , drop = TRUE] returnsa tibble (#442).
Theprint.tbl_df() method has been removed, theprint.tbl() method handles printing (#519).
tibble() supports columns that are matrices or dataframes (#416).
The new.rows argument totibble() andas_tibble() allows specifying the expected number of rowsexplicitly, even if it’s evident from the data. This allows writing moredefensive code.
Column name repair has more direct support, via the new.name_repair argument totibble() andas_tibble(). It takes the following values:
"minimal": No name repair or checks, beyond basicexistence."unique": Make sure names are unique and notempty."check_unique": (default value), no name repair, butcheck they areunique."universal": Make the namesunique andsyntactic..name_repair = make.names or.name_repair = ~make.names(., unique = TRUE) for names inthe style of base R).Thevalidate argument ofas_tibble() isdeprecated but supported (emits a message once per session). Use.name_repair = "minimal" instead ofvalidate = FALSE, and.name_repair = "check_unique" instead ofvalidate = TRUE. If you need to support older versions oftibble, pass both.name_repair andvalidatearguments in a consistent way, no message will be emitted in this case(#469,
Row name handling is stricter. Row names are never (and neverwere) supported intibble() andnew_tibble(),and are now stripped by default inas_tibble(). Therownames argument toas_tibble() supports:
NULL: remove row names (default),NA: keep row names,The old default can be restored by callingpkgconfig::set_config("tibble::rownames", NA), this alsoworks for packages that importtibble.
new_tibble() andas_tibble() now alsostrip the"dim" attribute from columns that areone-dimensional arrays. (tibble() already did thisbefore.)
Internally, allas_tibble() implementation forwardall extra arguments and... toas_tibble.list() where they are handled. This means thatthe common.rows and.name_repair can be usedfor all inputs. We suggest that your implementations of this method dothe same.
enframe() (withname = NULL) anddeframe() now support one-column tibbles (#449).
Improved S4 support by addingexportClass(tbl_df) toNAMESPACE (#436,
Newvalidate_tibble() checks a tibble for internalconsistency (#471).
Bring error message for invalid column type in line with allowedmatrix/df cols (#465,
view() function that always returnsits input invisibly and callsutils::View() only ininteractive mode (#373).Theset_tidy_names() andtidy_names()helpers the list of new names using a bullet list with at most six items(#406).
A one-character ellipse (cli::symbol$ellipsis) isprinted instead of"..." where available, this affectsglimpse() output and truncated lists (#403).
Column names and types are now formatted identically withglimpse() andprint.tbl_df().
tidy_names() quotes variable names when reporting onrepair (#407).
All error messages now follow the tidyverse style guide(#223).
as_tibble() prints an informative error message whenusing therownames argument and the input data frame ormatrix does not have row names (#388,
column_to_rownames() uses the real variable name inits error message (#399,
Lazy tibbles with exactly 10 rows no longer show “…with morerows” (#371).
glimpse() shows information obtained fromtbl_sum(), e.g. grouping information forgrouped_df from dplyr (#550).
glimpse() takes coloring into account when computingcolumn width, the output is no longer truncated prematurely whencoloring is enabled.
glimpse() disambiguates outputs for factors if thelevels contain commas (#384,
print.tbl_df() with a negative value forn behaves as ifn was omitted (#371).
Fixed output for extra column names that contain spaces.
Skip dplyr in tests if unavailable (#420,
Skip mockr in tests if unavailable (#454,
Usefansi::strwrap_ctl() instead of own stringwrapping routine.
tibble() uses recycled values during constructionbut unrecycled values for validation.
tibble() is now faster for very widetibbles.
Subsetting with the[ operator is faster(#544).
Avoid use ofstop() in examples if packages are notinstalled (#453,
Fixas_tibble() examples by using correct argumentnames inrequireNamespace() call (#424,
as_tibble() checks column length only once (#365,@anhqle).
Usingrlang::list2() (#391,
tibble.width option is honored again (#369).tbl[1, , drop = TRUE] now behaves identically to dataframes (#367).glimpse() returns its input for zero-column dataframes.enframe(NULL) now returns the same asenframe(logical()) (#352).tribble() now ignores trailing commas (#342,nrow() andhead() inglimpse(), notncol().The new pillar package is now responsible for formatting tibbles.Pillar will try to display as many columns as possible, if necessarytruncating or shortening the output. Colored output highlights importantinformation and guides the eye. The vignette in the tibble packagedescribes how to adapt custom data types for optimal display in atibble.
add_case() an alias foradd_row()(#324,as_tibble() gainsrownames argument (#288,#289).as_tibble.matrix() repairs column names.`[.tbl_df`() supportsdrop = TRUE andomits the warning ifj is passed. The callsdf[i, j, drop = TRUE] anddf[j, drop = TRUE]are now compatible with data frames again (#307, #311).glimpse() (#328).add_column() from dropping classes andattributes by removing the use ofcbind(). Additionallythis ensures thatadd_column() can be used with groupeddata frames (#303,add_column() to an empty zero-row tibble with avariable of nonzero length now produces a correct error message(#319).has_name() from rlang, instead offorwarding, to avoid warning when importing both rlang and tibble.tibble() call are recycledprior to evaluating subsequent arguments, improving consistency withmutate() (#213).tibble() callmaintains their class (#284).add_row() now always preserves the column data types ofthe input data frame the same way asrbind() does(#296).lst() now again handles duplicate names, the valuedefined last is used in case of a clash.validate argument is now also supported inas_tibble.tbl_df(), with default toFALSE(#278). It must be passed as named argument, as inas_tibble(validate = TRUE).format_v() now always surrounds lists with[] brackets, even if their length is one. This affectsglimpse() output for list columns (#106).glimpse()(#280).tibble() gives a consistent error message in the caseof duplicate column names (#291).format() andprint() methods forbothtbl andtbl_df classes, to protectagainst malformed tibbles that inherit from"tbl_df" butnot"tbl", as created e.g. byungroup() indplyr 0.5.0 and earlier (#256, #263).tidy_names(syntactic = TRUE, quiet = FALSE) if not allnames are fixed (#260,set_tidy_names() andtidy_names(), asimpler version ofrepair_names() which works unchanged fornow (#217).rowid_to_column() that adds arowidcolumn as first column and removes row names (#243,all.equal.tbl_df() method has been removed, callingall.equal() now forwards tobase::all.equal.data.frame(). To compare tibbles ignoringrow and column order, please usedplyr::all_equal()(#247).x again instead of the Unicodemultiplication sign, to avoid encoding issues (#216).print(),format(), andtbl_sum() methods are now implemented for class"tbl" and not for"tbl_df". This allowssubclasses to use tibble’s formatting facilities. The formatting of theheader can be tweaked by implementingtbl_sum() for thesubclass, which is expected to return a named character vector. Theprint.tbl_df() method is still implemented forcompatibility with downstream packages, but only callsNextMethod().print.data.frame()anymore. Now providingformat.tbl_df() and full support forUnicode characters in names and data, also forglimpse()(#235).rlang instead oflazyeval (#225,@lionel-), andrlang functions (#244).tribble() now handles values that have a class (#237,@NikNakk).any(is.na()) withanyNA() (#229,microbenchmark package is now used conditionally(#245).pkgdown website.mts andts) are now supported inas_tibble()(#184).all_equal() function (called byall.equal.tbl_df()) now forwards todplyr andfails with a helpful message if not installed. Data frames with listcolumns cannot be compared anymore, and differences in the declaredclass (data.frame vs. tbl_df) are ignored. Theall.equal.tbl_df() method gives a warning and forwards toNextMethod() ifdplyr is not installed; callall.equal(as.data.frame(...), ...) to avoid the warning.This ensures consistent behavior of this function, regardless ifdplyr is loaded or not (#198).as.tibble() as an alias toas_tibble()(#160,frame_matrix(), similar toframe_data() but for matrices (#140, #168,deframe() as reverse operation toenframe() (#146, #214).assertthat.add_column() can add columns of length 1 (#162, #164,add_row() for a grouped data frameresults in a helpful error message (#179).x if it cannot berepresented in the current locale (#192,NA names in printing (#206, #207,glimpse() now usestype_sum() also for S3objects (#185, #186,max.print option is ignored when printing a tibble(#194, #195,obj_sum documentation (#193,tribble() (#191,tibble.width option is used forglimpse() only if it is finite (#153,as_tibble.poly() to support conversion of apoly object to a tibble (#110).add_row() now correctly handles existing columns oftypelist that are not updated (#148).all.equal() doesn’t throw an error anymore if one ofthe columns is namedna.last,decreasing ormethod (#107,add_column(), analogously toadd_row()(#99).print.tbl_df() gainsn_extra method andwill have the same interface astrunc_mat() from nowon.add_row() andadd_column() gain.before and.after arguments which indicatethe row (by number) or column (by number or name) before or after whichthe new data are inserted. Updated or added columns cannot be named.before or.after (#99).frame_data() totribble(), standsfor “transposed tibble”. The former is still available as alias (#132,#143).add_row() now can add multiple rows, with recycling(#142,× instead ofx whenprinting dimensions (#126). Output tests had to be disabled for this onWindows.dttm instead oftime forPOSIXt values (#133), which is now used for columns of thedifftime class.print.tbl_df(), now using datafromnycflights13 instead ofLahman (#121),with guidance to installnycflights13 package if necessary(#152).Follow-up release.
tibble() is no longer an alias forframe_data() (#82).tbl_df() (#57).$ returnsNULL if column not found,without partial matching. A warning is given (#109).[[ returnsNULL if column not found(#109).# and contains more text (#95)), removed empty line,showing number of hidden rows and columns (#51). The trailing metadataalso begins with hash# (#101). Presence of row names isindicated by a star in printed output (#72).NA values in character columns as<NA>, likeprint.data.frame() does(#69).glimpse() shows nesting structure for lists and usesangle brackets for type (#98).POSIXlt columns can be printed now, thetext<POSIXlt> is shown as placeholder to encourageusage ofPOSIXct (#86).type_sum() shows only topmost class for S3objects.ncol aresupported. Passing a matrix or an array now raises an error in any case(#83).NULL row names (#75).stop() andwarning() are now always calledwithcall. = FALSE..Dim attribute is silently stripped from columnsthat are 1d matrices (#84).as_tibble.data.frame() preserves attributes, and usesas_tibble.list() to calling overriden methods which maylead to endless recursion.has_name() (#102).tibble() andas_tibble() overdata_frame() andas_data_frame() in code anddocumentation (#82).is.tibble() andis_tibble()(#79).enframe() that converts vectors to two-columntibbles (#31, #74).obj_sum() andtype_sum() show"tibble" instead of"tbl_df" for tibbles(#82).as_tibble.data.frame() gainsvalidateargument (as inas_tibble.list()), ifTRUE theinput is validated.as_tibble.default() (#71,hadley/dplyr#1752).has_rownames() supports arguments that are not dataframes.[[ works (#58, #63).x[]) also removesrow names.as_tibble.tbl_df() for subclasses(#60).knitr internals for testing (#78).knitr 1.13 (#76).knit_print() tests.tbl_sum.tbl_sql()andtbl_sum.tbl_grouped_df() to allowdplyrrelease before atibble release.format_v() (#98).NULL value oftbl_sum().expect_output_file() fromtestthat.Initial CRAN release
Extracted fromdplyr 0.4.3
Exported functions:
tbl_df()as_data_frame()data_frame(),data_frame_()frame_data(),tibble()glimpse()trunc_mat(),knit_print.trunc_mat()type_sum()lst() andlst_() create lists in thesame way thatdata_frame() anddata_frame_()create data frames (hadley/dplyr#1290).lst(NULL) doesn’traise an error (#17,NULL).add_row() makes it easy to add a new row to dataframe (hadley/dplyr#1021).rownames_to_column() andcolumn_to_rownames() (#11,has_rownames() andremove_rownames()(#44).repair_names() fixes missing and duplicate names(#10, #15,is_vector_s3().Features
as_data_frame.table() with argumentnto control name of count column (#22, #23).tibble prefix for options (#13, #36).glimpse() now (invisibly) returns its argument(hadley/dplyr#1570). It is now a generic, the default method dispatchestostr() (hadley/dplyr#1325). The default width is obtainedfrom thetibble.width option (#35, #56).as_data_frame() is now an S3 generic with methods forlists (the oldas_data_frame()), data frames (trivial),matrices (with efficient C++ implementation) (hadley/dplyr#876), andNULL (returns a 0-row 0-column data frame) (#17,frame_data() andtibble() (including lists) creates list-valued columns(#7). These functions return 0-row but n-col data frame if no data.Bug fixes
frame_data() properly constructs rectangular tables(hadley/dplyr#1377,Minor modifications
setOldClass(c("tbl_df", "tbl", "data.frame")) tohelp with S4 (hadley/dplyr#969).tbl_df() automatically generates column names(hadley/dplyr#1606).tbl_dfs gain$ and[[ methodsthat are ~5x faster than the defaults, never do partial matching(hadley/dplyr#1504), and throw an error if the variable does not exist.[[.tbl_df() falls back to regular subsetting when used withanything other than a single string (#29).base::getElement() now works with tibbles (#9).all_equal() allows to compare data frames ignoring rowand column order, and optionally ignoring minor differences in type(e.g. int vs. double) (hadley/dplyr#821). Used byall.equal() for tibbles. (This package contains a pure Rimplementation ofall_equal(), thedplyr codehas identical behavior but is written in C++ and thus faster.)data_frame() andas_data_frame() have been aligned, soas_data_frame() will now automatically recycle length-1vectors. Both functions give more informative error messages if you areattempting to create an invalid data frame. You can no longer create adata frame with duplicated names (hadley/dplyr#820). Both functions nowcheck that you don’t have anyPOSIXlt columns, and tell youto usePOSIXct if you do (hadley/dplyr#813).data_frame(NULL) raises error “must be a 1d atomic vectoror list”.trunc_mat() andprint.tbl_df() areconsiderably faster if you have very wide data frames. They will nowalso only list the first 100 additional variables not already on screen- control this with the newn_extra parameter toprint() (hadley/dplyr#1161). The type of list columns isprinted correctly (hadley/dplyr#1379). Thewidth argumentis used also for 0-row or 0-column data frames (#18).[.tbl_df() does not change class (#41,@jennybc). Improve[.tbl_df() error message.Documentation
vignette("tibble") describes the difference betweentbl_dfs and regular data frames (hadley/dplyr#1468).Code quality
obj_type() toobj_sum(),improvements, better integration withtype_sum().