1<!-- NEWS.md is maintained by https://cynkra.github.io/fledge, do not edit --> 2 3# tibble 3.1.6 4 5- `set_num_opts()` and `set_char_opts()` are reexported from pillar (#959). 6- `view()` uses `rlang::expr_deparse(width = Inf)` to avoid errors with long `|>` pipes (#957). 7- `new_tibble()` checks that the `nrow` argument is nonnegative and less than 2^31 (#916). 8- `tbl_sum.tbl_df()` has an ellipsis in its formals for extensibility. 9 10 11# tibble 3.1.5 12 13- Avoid necessity to set `"tibble.view_max"` option for lazy tables (#954). 14- Avoid blanket import for lifecycle package for compatibility with upcoming rlang (#955, @romainfrancois). 15 16 17# tibble 3.1.4 18 19## Features 20 21- `as.data.frame.tbl_df()` strips inner column names (#837). 22- `new_tibble()` allows omitting the `nrow` argument again (#781). 23 24## Documentation 25 26- Move `vignette("digits")`, `vignette("numbers")`, `?num` and `?char` from the pillar package here (#913). 27- Replace `iris` by `trees` (#943). 28- Various documentation improvements. 29- New `?tibble_options` help page (#912). 30 31## Performance 32 33- `x[i, j] <- one_row_value` avoids explicit recycling of the right-hand side, the recycling happens implicitly in `vctrs::vec_assign()` for performance (#922). 34 35## Internal 36 37- Vignettes are now tested with a snapshot test (#919). 38- `new_tibble()` uses `vctrs::new_data_frame()` internally (#726, @DavisVaughan). 39- Adapt to pillar 1.6.2. 40- Fix tests for compatibility with pillar 1.6.2. 41 42 43# tibble 3.1.3 44 45## Bug fixes 46 47- `tbl[row, col] <- rhs` treats an all-`NA` logical vector as a missing value both for existing data (#773) and for the right-hand side value (#868). This means that a column initialized with `NA` (of type `logical`) will change its type when a row is updated to a value of a different type. 48- `[[<-()` supports symbols (#893). 49 50## Features 51 52- `as_tibble_row()` supports arbitrary vectors (#797). 53- `enframe()` and `deframe()` support arbitrary vectors (#730). 54- `tibble()` and `tibble_row()` ignore all columns that evaluate to `NULL`, not only those where a verbatim `NULL` is passed (#895, #900). 55- `new_tibble()` is now faster (#901, @mgirlich). 56 57## Internal 58 59- Establish compatibility with rlang > 0.4.11 (#908). 60- Use `pillar::dim_desc()` (#859). 61- Establish compatibility with testthat > 3.0.3 (#896, @lionel-). 62- Bump required versions of ellipsis and vctrs to avoid warning during package load. 63 64 65# tibble 3.1.2 66 67- Bump required versions of ellipsis and vctrs to avoid warning during package load. 68 69 70# tibble 3.1.1 71 72- `num()` and `char()` are reexported from pillar (#880). 73- `tribble()` and `frame_matrix()` give an error if values are named (#871, @lorenzwalthert). 74- Document `cli.num_colors` option (#410). 75- Fix `new_tibble()` examples for compatibility with pillar 1.6.0. 76 77 78# tibble 3.1.0 79 80## Bug fixes 81 82- `has_rownames()` now works correctly for data frames with a `"row.names"` attribute malformed due to a problem in `structure()` (#852). 83 84- `tbl[FALSE, "column"] <- x` adds new column again (#846). 85 86## Features 87 88- Importing pillar 1.5.0, cli and crayon are now suggested packages (#475). 89 90- `size_sum()` is now reexported from pillar (#850, @topepo). 91 92- `as_tibble()` hints more often to use the `.name_repair` argument if column names are invalid (#855). 93 94- `as_tibble.table()` mentions `.name_repair` argument in the error message (#839). 95 96## Internal 97 98- Remove compatibility code for pillar < 1.5.0 (#861). 99 100- Moved most functions to the "stable" lifecycle (#860). 101 102 103# tibble 3.0.6 104 105- `vec_ptype_abbr.tbl_df()` and `type_sum.tbl_df()` now uses the name of the topmost class for subclasses of `"tbl_df"` (#843). 106- Ignore errors in `formats.Rmd` vignette. 107- Avoid tidy evaluation in pillar compatibility code. 108 109 110# tibble 3.0.5 111 112- Use testthat edition 3, compatible with testthat 3.0.1 (#827, #832). 113 114 115# tibble 3.0.4 116 117## Compatibility 118 119- Establish compatibility with upcoming pillar 1.5.0 (#818). 120 121- `tbl_sum()` shows "data frame" instead of "tibble" for objects inheriting from `"tbl"` but not `"tbl_df"` (#818). 122 123- Register `format.tbl()` and `print.tbl()` methods only if pillar doesn't (#816). 124 125- Use `vctrs::num_as_location()` internally for subset assignment of rows and columns for better error messages (#746). 126 127- Adapt tests to the development version of testthat. 128 129## Bug fixes 130 131- Fix documentation link to `base::Extract`. 132 133- `add_row(df)` adds an empty row again (#809, @DavisVaughan). 134 135 136# tibble 3.0.3 137 138- Fix test compatibility with rlang 0.4.7. 139 140- Fix warning about `needs_dots` arguments with pillar >= 1.4.5 (#798). 141 142 143# tibble 3.0.2 144 145## Bug fixes 146 147- `[[` works with classed indexes again, e.g. created with `glue::glue()` (#778). 148 149- `add_column()` works without warning for 0-column data frames (#786). 150 151- `tribble()` now better handles named inputs (#775) and objects of non-vtrs classes like `lubridate::Period` (#784) and `formattable::formattable` (#785). 152 153## Performance 154 155- Subsetting and subassignment are faster (#780, #790, #794). 156 157- `is.null()` is preferred over `is_null()` for speed. 158 159- Implement continuous benchmarking (#793). 160 161## Compatibility 162 163- `is_vector_s3()` is no longer reexported from pillar (#789). 164 165 166# tibble 3.0.1 167 168## Compatibility fixes 169 170- `[<-.tbl_df()` coerces matrices to data frames (#762). 171 172- Use delayed import for cli to work around unload problems in downstream packages (#754). 173 174 175## Bug fixes 176 177- More soft-deprecation warnings are actually visible. 178 179- If `.name_repair` is a function, no repair messages are shown (#763). 180 181- Remove superseded signal for `as_tibble.list()`, because `as_tibble_row()` only works for size 1. 182 183 184## Enhancements 185 186- `as_tibble(validate = )` now always triggers a deprecation warning. 187 188- Subsetting and subassignment of rows with one-column matrices work again, with a deprecation warning (#760). 189 190- Attempts to update a tibble row with an atomic vector give a clearer error message. Recycling message for subassignment appears only if target size is != 1. 191 192- Tweak title of "Invariants" vignette. 193 194 195# tibble 3.0.0 196 197## Major breaking changes 198 199- Subset assignment ("subassignment") and also subsetting has become stricter. Symptoms: 200 201 - Error: No common type for ... 202 203 - Error: Assigned data `...` must be compatible with ... 204 205 - `i` must have one dimension, not 2 206 207 - Error: Lossy cast from ... to ... 208 209 The "invariants" article at https://tibble.tidyverse.org/dev/articles/invariants.html describes the invariants that the operations follow in tibble, and the most important differences to data frames. We tried to make subsetting and subassignment as safe as possible, so that errors are caught early on, while introducing as little friction as possible. 210 211- List classes are no longer automatically treated as vectors. Symptoms: 212 213 - Error: All columns in a tibble must be vectors 214 215 - Error: Expected a vector, not a `...` object 216 217 If you implement a class that wraps a list as S3 vector, you need to include `"list"` in the class: 218 219 ```r 220 structure(x, class = c("your_s3_class", "list")) 221 ``` 222 223 Alternatively, implement a `vec_proxy()` method as described in https://vctrs.r-lib.org/reference/vec_data.html, or construct your class with `list_of()`. 224 225- Added experimental support for inner names for all columns, of the form `tibble(a = c(b = 1))`. Inner names are no longer stripped when creating a tibble. They are maintained for slicing operations but not yet updated when assigning with a row subscript. This is a change that may break existing comparison tests that don't expect names in columns (#630). Symptoms: 226 227 - "names for target but not for current" when comparing 228 229 230## Breaking changes 231 232- `tibble()` now splices anonymous data frames, `tibble(tibble(a = 1), b = a)` is equivalent to `tibble(a = 1, b = a)`. This means that `tibble(trees)` now has three columns, use `tibble(trees = trees)` if the intention is to create a packed data frame (#581). 233 234- The `name-repair` help topic is gone, refer to `?vctrs::vec_as_names` instead. 235 236- `expression()` columns are converted to lists as a workaround for lacking support in vctrs (#657). 237 238- `tribble()` is now stricter when combining values. All values in a column must be compatible, otherwise an error occurs (#204). The criteria for wrapping in a list column are now based on vctrs principles: non-vectors or vectors with `vctrs::vec_size()` unequal 1 are wrapped in lists. 239 240- `$` warns unconditionally if column not found, `[[` doesn't warn. 241 242- `add_row()` now uses `vctrs::vec_rbind()` under the hood, this means that all columns are combined with `vctrs::vec_c()`. In particular, factor columns will be converted to character if one of the columns is a character column. 243 244 245## Soft deprecations 246 247- Soft-deprecate `subclass` argument to `new_tibble()`. 248 249- Soft-deprecate `as_tibble()` without arguments (#683). 250 251- Preparing to move `glimpse()` and `tbl_sum()` to the pillar package. If your package implements these methods, please import the generics from pillar as soon as they become available there. 252 253 254## Features 255 256- Internals now make heavy use of the vctrs package, following most of the invariants defined there. Name repair is the responsibility of vctrs now (#464). 257 258- All errors emitted directly by the package inherit from the `"tibble_error"` and `"rlang_error"` classes. In some cases, `"vctrs_error"` errors may be passed through. The exact subclass is subject to change. 259 260 Example: `tibble(a = quote(b))` raises an error that inherits from `"tibble_error_column_must_be_vector"`, `"tibble_error"` and `"rlang_error"`, and from `"error"` and `"condition"` like all errors. Do not rely on the wording of `"tibble_error_column_must_be_vector"`, this is likely to change. 261 262 Use the following pattern to catch errors emitted by tibble: 263 264 ```r 265 tryCatch( 266 your_code(), 267 tibble_error = function(cnd) { 268 } 269 ) 270 ``` 271 272- New `tibble_row()` constructs tibbles that have exactly one row, or fails. Non-vector objects are automatically wrapped in a list, vectors (including lists) must have length one (#205). 273 274- New `as_tibble_row()` and `as_tibble_col()` convert a bare vector to a one-row or one-column tibble, respectively. `as_tibble_col()` also works for non-bare vectors. Using `as_tibble()` for bare vectors is superseded (#447). 275 276- `as_tibble.data.frame()` uses implicit row names if asked to create a column from row names. This allows lossless direct conversion of matrices with row names to tibbles (#567, @stufield). 277 278- Implement `str.tbl_df()` (#480). 279 280- `tribble()` now returns columns with `"unspecified"` type for 0-row tibbles. 281 282- `add_row()` and `add_column()` now restore attributes to avoid errors when appending to sf objects or other tibble subclasses (#662). 283 284- `add_column()` gains `.name_repair` argument. If not given, `.data` must have unique columns, with a deprecation message. 285 286- Allow `POSIXlt` columns, they are now better supported by dplyr and other tools thanks to vctrs (#626). 287 288- `tibble()` ignores NULL arguments, named or unnamed (#580). 289 290- `view()` works for remote data sources by applying the same strategy as `print()` and `glimpse()`. The maximum number of rows in this case can be specified using the new `n` argument, by default it is taken from the new `"tibble.view_max"` option (#695). 291 292 293## Output 294 295- Formatting dimensions never uses scientific notation. 296 297- `glimpse()` uses "Rows" and "Columns" instead of "Variables" and "Observations", because we're not sure if the data is tidy here (#614). 298 299- `view()` now uses the created (or passed) title argument (#610, @xvrdm). 300 301 302## Performance 303 304- Construction and subsetting of large data frames is faster now (#717, @romainfrancois). 305 306 307## Internal 308 309- Import lifecycle package (#669). 310 311- `new_tibble()` removes redundant subclasses from the `"class"` attribute. 312 313- Using classed conditions. All classes start with `"tibble_error_"` and also contain `"tibble_error"` (#659). 314 315- The magrittr pipe `%>%` is reexported. 316 317 318# tibble 2.1.3 319 320- Fix compatibility with R 3.5 and earlier, regression introduced in tibble 2.1.2. 321 322 323# tibble 2.1.2 324 325- Relax version requirements. 326 327- Fix test failing after pillar upgrade. 328 329 330# tibble 2.1.1 331 332- Three dots are used even for `"unique"` name repair (#566). 333 334- `add_row()`, `add_case()` and `add_column()` now signal a warning once per session if the input is not a data frame (#575). 335 336- Fix `view()` for the case when an object named `x` exists in the global environment (#579). 337 338 339# tibble 2.0.1 340 341- tibble names can again be set to `NULL` within RStudio, as some R routines within RStudio relied on this behaviour (#563, @kevinushey). 342 343- `as_tibble.matrix(validate = TRUE)` works again, with a lifecycle warning (#558). 344 345- Replace `new_list_along()` by `rep_along()` to support rlang 0.3.1 (#557, @lionel-). 346 347 348# tibble 2.0.0 349 350## Breaking changes 351 352The `tibble()` and `as_tibble()` functions, and the low-level `new_tibble()` constructor, have undergone a major overhaul to improve consistency. We suspect that package code will be affected more than analysis code. 353 354To improve compatibility with existing code, breaking changes were reduced to a minimum and in some cases replaced with a warning that appears once per session. Call `tibble:::scoped_lifecycle_errors()` when updating your packages or scripts to the new semantics API to turn these warnings into errors. The compatibility code will be removed in tibble 3.0.0. 355 356- All optional arguments have moved past the ellipsis, and must be specified as named arguments. This affects mostly the `n` argument to `as_tibble.table()`, passing `n` unnamed still works (with a warning). 357 358- `new_tibble()` has been optimized for performance, the function no longer strips dimensions from 1d arrays and no longer checks correctness of names or column lengths. (It still checks if the object is named, except for zero-length input.) Use the new `validate_tibble()` if you need these checks (#471). 359 360- The `nrow` argument to `new_tibble()` is now mandatory. The `class` argument replaces the now deprecated `subclass` argument, the latter will be supported quietly for some time (#518). 361 362- Setting names on a tibble via `names(df) <- ...` now also requires minimal names, otherwise a warning is issued once per session (#466). 363 364- In `as_tibble()`, checking names is also enabled by default, even for tibbles, matrices and other matrix-like objects: names must exist, `NA` names are not allowed. Coercing a matrix without column names will trigger a warning once per session. (This corresponds to the `"minimal"` checks described below.). 365 366- The `validate` argument to `as_tibble()` has been deprecated, see below for alternatives. (The `as_tibble.tbl_df()` method has been removed, the `as_tibble.data.frame()` method will be used for tibbles.) 367 368- `as_tibble()` always checks that all columns are 1D or 2D vectors and not of type `POSIXlt`, even with `validate = FALSE` (which is now deprecated). 369 370- Calling `as_tibble()` on a vector now warns once per session. Use `enframe(name = NULL)` for converting a vector to a one-column tibble, or `enframe()` for converting a named vector to a two-column tibble. 371 372- `data_frame()` and `frame_data()` are soft-deprecated, please use `tibble()` or `tribble()` (#111). 373 374- `tibble_()`, `data_frame_()`, and `lst_()` are soft-deprecated. Please use `tibble()` or `lst()` (#111, #509). 375 376- `as.tibble()` and `as_data_frame()` are officially deprecated and not generic anymore, please use/implement `as_tibble()` (#111). 377 378- `as_tibble.data.frame()` (and also `as_tibble.matrix()`) strip row names by default. Code that relies on tibbles keeping row names now will see: 379 - a different result when calling `rownames()` or `row.names()`, 380 - rows full of `NA` values when subsetting rows with with a character vector, e.g. `as_tibble(mtcars)["Mazda RX4", ]`. 381 382 Call `pkgconfig::set_config("tibble::rownames", NA)` to revert to the old behavior of keeping row names. Packages that import _tibble_ can call `set_config()` in their `.onLoad()` function (#114). 383 384- `as_tibble()` drops extra classes, in particular `as_tibble.grouped_df()` now removes grouping (#535). 385 386- `column_to_rownames()` now always coerces to a data frame, because row names are no longer supported in tibbles (#114). 387 388- In all `*_rownames()` functions, the first argument has been renamed to `.data` for consistency (#412). 389 390- Subsetting one row with `[..., , drop = TRUE]` returns a tibble (#442). 391 392- The `print.tbl_df()` method has been removed, the `print.tbl()` method handles printing (#519). 393 394 395## New features 396 397- `tibble()` supports columns that are matrices or data frames (#416). 398 399- The new `.rows` argument to `tibble()` and `as_tibble()` allows specifying the expected number of rows explicitly, even if it's evident from the data. This allows writing more defensive code. 400 401- Column name repair has more direct support, via the new `.name_repair` argument to `tibble()` and `as_tibble()`. It takes the following values: 402 403 - `"minimal"`: No name repair or checks, beyond basic existence. 404 - `"unique"`: Make sure names are unique and not empty. 405 - `"check_unique"`: (default value), no name repair, but check they are `unique`. 406 - `"universal"`: Make the names `unique` and syntactic. 407 - a function: apply custom name repair (e.g., `.name_repair = make.names` or `.name_repair = ~make.names(., unique = TRUE)` for names in the style of base R). 408 409 The `validate` argument of `as_tibble()` is deprecated but supported (emits a message once per session). Use `.name_repair = "minimal"` instead of `validate = FALSE`, and `.name_repair = "check_unique"` instead of `validate = TRUE`. If you need to support older versions of tibble, pass both `.name_repair` and `validate` arguments in a consistent way, no message will be emitted in this case (#469, @jennybc). 410 411- Row name handling is stricter. Row names are never (and never were) supported in `tibble()` and `new_tibble()`, and are now stripped by default in `as_tibble()`. The `rownames` argument to `as_tibble()` supports: 412 413 - `NULL`: remove row names (default), 414 - `NA`: keep row names, 415 - A string: the name of the new column that will contain the existing row names, 416 which are no longer present in the result. 417 418 The old default can be restored by calling `pkgconfig::set_config("tibble::rownames", NA)`, this also works for packages that import _tibble_. 419 420- `new_tibble()` and `as_tibble()` now also strip the `"dim"` attribute from columns that are one-dimensional arrays. (`tibble()` already did this before.) 421 422- Internally, all `as_tibble()` implementation forward all extra arguments and `...` to `as_tibble.list()` where they are handled. This means that the common `.rows` and `.name_repair` can be used for all inputs. We suggest that your implementations of this method do the same. 423 424- `enframe()` (with `name = NULL`) and `deframe()` now support one-column tibbles (#449). 425 426- Improved S4 support by adding `exportClass(tbl_df)` to `NAMESPACE` (#436, @jeffreyhanson and @javierfajnolla). 427 428- New `validate_tibble()` checks a tibble for internal consistency (#471). 429 430- Bring error message for invalid column type in line with allowed matrix/df cols (#465, @maxheld83). 431 432 433## New functions 434 435- Added experimental `view()` function that always returns its input invisibly and calls `utils::View()` only in interactive mode (#373). 436 437 438## Output 439 440- The `set_tidy_names()` and `tidy_names()` helpers the list of new names using a bullet list with at most six items (#406). 441 442- A one-character ellipse (`cli::symbol$ellipsis`) is printed instead of `"..."` where available, this affects `glimpse()` output and truncated lists (#403). 443 444- Column names and types are now formatted identically with `glimpse()` and `print.tbl_df()`. 445 446- `tidy_names()` quotes variable names when reporting on repair (#407). 447 448- All error messages now follow the tidyverse style guide (#223). 449 450- `as_tibble()` prints an informative error message when using the `rownames` argument and the input data frame or matrix does not have row names (#388, @anhqle). 451 452- `column_to_rownames()` uses the real variable name in its error message (#399, @alexwhan). 453 454- Lazy tibbles with exactly 10 rows no longer show "...with more rows" (#371). 455 456- `glimpse()` shows information obtained from `tbl_sum()`, e.g. grouping information for `grouped_df` from dplyr (#550). 457 458## Bug fixes 459 460- `glimpse()` takes coloring into account when computing column width, the output is no longer truncated prematurely when coloring is enabled. 461 462- `glimpse()` disambiguates outputs for factors if the levels contain commas (#384, @anhqle). 463 464- `print.tbl_df()` with a negative value for `n` behaves as if `n` was omitted (#371). 465 466- Fixed output for extra column names that contain spaces. 467 468 469 470## Internal 471 472- Skip dplyr in tests if unavailable (#420, @QuLogic). 473 474- Skip mockr in tests if unavailable (#454, @Enchufa2). 475 476- Use `fansi::strwrap_ctl()` instead of own string wrapping routine. 477 478- `tibble()` uses recycled values during construction but unrecycled values for validation. 479 480- `tibble()` is now faster for very wide tibbles. 481 482- Subsetting with the `[` operator is faster (#544). 483 484- Avoid use of `stop()` in examples if packages are not installed (#453, @Enchufa2). 485 486- Fix `as_tibble()` examples by using correct argument names in `requireNamespace()` call (#424, @michaelweylandt). 487 488- `as_tibble()` checks column length only once (#365, @anhqle). 489 490- Using `rlang::list2()` (#391, @lionel-). 491 492 493 494# tibble 1.4.2 495 496Bug fixes 497--------- 498 499- Fix OS X builds. 500- The `tibble.width` option is honored again (#369). 501- `tbl[1, , drop = TRUE]` now behaves identically to data frames (#367). 502- Fix error message when accessing columns using a logical index vector (#337, @mundl). 503- `glimpse()` returns its input for zero-column data frames. 504 505Features 506-------- 507 508- `enframe(NULL)` now returns the same as `enframe(logical())` (#352). 509- `tribble()` now ignores trailing commas (#342, @anhqle). 510- Updated vignettes and website documentation. 511 512Performance 513----------- 514 515- Faster printing of very wide tibbles (#360). 516- Faster construction and subsetting for tibbles (#353). 517- Only call `nrow()` and `head()` in `glimpse()`, not `ncol()`. 518 519 520# tibble 1.4.1 521 522## New formatting 523 524The new pillar package is now responsible for formatting tibbles. Pillar will try to display as many columns as possible, if necessary truncating or shortening the output. Colored output highlights important information and guides the eye. The vignette in the tibble package describes how to adapt custom data types for optimal display in a tibble. 525 526## New features 527 528- Make `add_case()` an alias for `add_row()` (#324, @LaDilettante). 529- `as_tibble()` gains `rownames` argument (#288, #289). 530- `as_tibble.matrix()` repairs column names. 531- Tibbles now support character subsetting (#312). 532- ``` `[.tbl_df`() ``` supports `drop = TRUE` and omits the warning if `j` is passed. The calls `df[i, j, drop = TRUE]` and `df[j, drop = TRUE]` are now compatible with data frames again (#307, #311). 533 534## Bug fixes 535 536- Improved compatibility with remote data sources for `glimpse()` (#328). 537- Logical indexes are supported, a warning is raised if the length does not match the number of rows or 1 (#318). 538- Fixed width for word wrapping of the extra information (#301). 539- Prevent `add_column()` from dropping classes and attributes by removing the use of `cbind()`. Additionally this ensures that `add_column()` can be used with grouped data frames (#303, @DavisVaughan). 540- `add_column()` to an empty zero-row tibble with a variable of nonzero length now produces a correct error message (#319). 541 542## Internal changes 543 544- Reexporting `has_name()` from rlang, instead of forwarding, to avoid warning when importing both rlang and tibble. 545- Compatible with R 3.1 (#323). 546- Remove Rcpp dependency (#313, @patperry). 547 548 549# tibble 1.3.4 550 551## Bug fixes 552 553- Values of length 1 in a `tibble()` call are recycled prior to evaluating subsequent arguments, improving consistency with `mutate()` (#213). 554- Recycling of values of length 1 in a `tibble()` call maintains their class (#284). 555- `add_row()` now always preserves the column data types of the input data frame the same way as `rbind()` does (#296). 556- `lst()` now again handles duplicate names, the value defined last is used in case of a clash. 557- Adding columns to zero-row data frames now also works when mixing lengths 1 and 0 in the new columns (#167). 558- The `validate` argument is now also supported in `as_tibble.tbl_df()`, with default to `FALSE` (#278). It must be passed as named argument, as in `as_tibble(validate = TRUE)`. 559 560## Formatting 561 562- `format_v()` now always surrounds lists with `[]` brackets, even if their length is one. This affects `glimpse()` output for list columns (#106). 563- Factor levels are escaped when printing (#277). 564- Non-syntactic names are now also escaped in `glimpse()` (#280). 565- `tibble()` gives a consistent error message in the case of duplicate column names (#291). 566 567 568# tibble 1.3.3 569 570## Bug fixes 571 572- Added `format()` and `print()` methods for both `tbl` and `tbl_df` classes, to protect against malformed tibbles that inherit from `"tbl_df"` but not `"tbl"`, as created e.g. by `ungroup()` in dplyr 0.5.0 and earlier (#256, #263). 573- The column width for non-syntactic columns is computed correctly again (#258). 574- Printing a tibble doesn't apply quote escaping to list columns. 575- Fix error in `tidy_names(syntactic = TRUE, quiet = FALSE)` if not all names are fixed (#260, @imanuelcostigan). 576- Remove unused import declaration for assertthat. 577 578 579# tibble 1.3.1 580 581## Bug fixes 582 583- Subsetting zero columns no longer returns wrong number of rows (#241, @echasnovski). 584 585 586## Interface changes 587 588- New `set_tidy_names()` and `tidy_names()`, a simpler version of `repair_names()` which works unchanged for now (#217). 589- New `rowid_to_column()` that adds a `rowid` column as first column and removes row names (#243, @barnettjacob). 590- The `all.equal.tbl_df()` method has been removed, calling `all.equal()` now forwards to `base::all.equal.data.frame()`. To compare tibbles ignoring row and column order, please use `dplyr::all_equal()` (#247). 591 592 593## Formatting 594 595- Printing now uses `x` again instead of the Unicode multiplication sign, to avoid encoding issues (#216). 596- String values are now quoted when printing if they contain non-printable characters or quotes (#253). 597- The `print()`, `format()`, and `tbl_sum()` methods are now implemented for class `"tbl"` and not for `"tbl_df"`. This allows subclasses to use tibble's formatting facilities. The formatting of the header can be tweaked by implementing `tbl_sum()` for the subclass, which is expected to return a named character vector. The `print.tbl_df()` method is still implemented for compatibility with downstream packages, but only calls `NextMethod()`. 598- Own printing routine, not relying on `print.data.frame()` anymore. Now providing `format.tbl_df()` and full support for Unicode characters in names and data, also for `glimpse()` (#235). 599 600 601## Misc 602 603- Improve formatting of error messages (#223). 604- Using `rlang` instead of `lazyeval` (#225, @lionel-), and `rlang` functions (#244). 605- `tribble()` now handles values that have a class (#237, @NikNakk). 606- Minor efficiency gains by replacing `any(is.na())` with `anyNA()` (#229, @csgillespie). 607- The `microbenchmark` package is now used conditionally (#245). 608- `pkgdown` website. 609 610 611# tibble 1.3.0 612 613## Bug fixes 614 615- Time series matrices (objects of class `mts` and `ts`) are now supported in `as_tibble()` (#184). 616- The `all_equal()` function (called by `all.equal.tbl_df()`) now forwards to `dplyr` and fails with a helpful message if not installed. Data frames with list columns cannot be compared anymore, and differences in the declared class (`data.frame` vs. `tbl_df`) are ignored. The `all.equal.tbl_df()` method gives a warning and forwards to `NextMethod()` if `dplyr` is not installed; call `all.equal(as.data.frame(...), ...)` to avoid the warning. This ensures consistent behavior of this function, regardless if `dplyr` is loaded or not (#198). 617 618## Interface changes 619 620- Now requiring R 3.1.0 instead of R 3.1.3 (#189). 621- Add `as.tibble()` as an alias to `as_tibble()` (#160, @LaDilettante). 622- New `frame_matrix()`, similar to `frame_data()` but for matrices (#140, #168, @LaDilettante). 623- New `deframe()` as reverse operation to `enframe()` (#146, #214). 624- Removed unused dependency on `assertthat`. 625 626## Features 627 628### General 629 630- Keep column classes when adding row to empty tibble (#171, #177, @LaDilettante). 631- Singular and plural variants for error messages that mention a list of objects (#116, #138, @LaDilettante). 632- `add_column()` can add columns of length 1 (#162, #164, @LaDilettante). 633 634### Input validation 635 636- An attempt to read or update a missing column now throws a clearer warning (#199). 637- An attempt to call `add_row()` for a grouped data frame results in a helpful error message (#179). 638 639### Printing 640 641- Render Unicode multiplication sign as `x` if it cannot be represented in the current locale (#192, @ncarchedi). 642- Backtick `NA` names in printing (#206, #207, @jennybc). 643- `glimpse()` now uses `type_sum()` also for S3 objects (#185, #186, @holstius). 644- The `max.print` option is ignored when printing a tibble (#194, #195, @t-kalinowski). 645 646## Documentation 647 648- Fix typo in `obj_sum` documentation (#193, @etiennebr). 649- Reword documentation for `tribble()` (#191, @kwstat). 650- Now explicitly stating minimum Rcpp version 0.12.3. 651 652## Internal 653 654- Using registration of native routines. 655 656 657# tibble 1.2 658 659## Bug fixes 660 661- The `tibble.width` option is used for `glimpse()` only if it is finite (#153, @kwstat). 662- New `as_tibble.poly()` to support conversion of a `poly` object to a tibble (#110). 663- `add_row()` now correctly handles existing columns of type `list` that are not updated (#148). 664- `all.equal()` doesn't throw an error anymore if one of the columns is named `na.last`, `decreasing` or `method` (#107, @BillDunlap). 665 666## Interface changes 667 668- New `add_column()`, analogously to `add_row()` (#99). 669- `print.tbl_df()` gains `n_extra` method and will have the same interface as `trunc_mat()` from now on. 670- `add_row()` and `add_column()` gain `.before` and `.after` arguments which indicate the row (by number) or column (by number or name) before or after which the new data are inserted. Updated or added columns cannot be named `.before` or `.after` (#99). 671- Rename `frame_data()` to `tribble()`, stands for "transposed tibble". The former is still available as alias (#132, #143). 672 673## Features 674 675- `add_row()` now can add multiple rows, with recycling (#142, @jennybc). 676- Use multiply character `×` instead of `x` when printing dimensions (#126). Output tests had to be disabled for this on Windows. 677- Back-tick non-semantic column names on output (#131). 678- Use `dttm` instead of `time` for `POSIXt` values (#133), which is now used for columns of the `difftime` class. 679- Better output for 0-row results when total number of rows is unknown (e.g., for SQL data sources). 680 681## Documentation 682 683- New object summary vignette that shows which methods to define for custom vector classes to be used as tibble columns (#151). 684- Added more examples for `print.tbl_df()`, now using data from `nycflights13` instead of `Lahman` (#121), with guidance to install `nycflights13` package if necessary (#152). 685- Minor changes in vignette (#115, @helix123). 686 687 688# tibble 1.1 689 690Follow-up release. 691 692## Breaking changes 693 694- `tibble()` is no longer an alias for `frame_data()` (#82). 695- Remove `tbl_df()` (#57). 696- `$` returns `NULL` if column not found, without partial matching. A warning is given (#109). 697- `[[` returns `NULL` if column not found (#109). 698 699 700## Output 701 702- Reworked output: More concise summary (begins with hash `#` and contains more text (#95)), removed empty line, showing number of hidden rows and columns (#51). The trailing metadata also begins with hash `#` (#101). Presence of row names is indicated by a star in printed output (#72). 703- Format `NA` values in character columns as `<NA>`, like `print.data.frame()` does (#69). 704- The number of printed extra cols is now an option (#68, @lionel-). 705- Computation of column width properly handles wide (e.g., Chinese) characters, tests still fail on Windows (#100). 706- `glimpse()` shows nesting structure for lists and uses angle brackets for type (#98). 707- Tibbles with `POSIXlt` columns can be printed now, the text `<POSIXlt>` is shown as placeholder to encourage usage of `POSIXct` (#86). 708- `type_sum()` shows only topmost class for S3 objects. 709 710 711## Error reporting 712 713- Strict checking of integer and logical column indexes. For integers, passing a non-integer index or an out-of-bounds index raises an error. For logicals, only vectors of length 1 or `ncol` are supported. Passing a matrix or an array now raises an error in any case (#83). 714- Warn if setting non-`NULL` row names (#75). 715- Consistently surround variable names with single quotes in error messages. 716- Use "Unknown column 'x'" as error message if column not found, like base R (#94). 717- `stop()` and `warning()` are now always called with `call. = FALSE`. 718 719 720## Coercion 721 722- The `.Dim` attribute is silently stripped from columns that are 1d matrices (#84). 723- Converting a tibble without row names to a regular data frame does not add explicit row names. 724- `as_tibble.data.frame()` preserves attributes, and uses `as_tibble.list()` to calling overriden methods which may lead to endless recursion. 725 726 727## New features 728 729- New `has_name()` (#102). 730- Prefer `tibble()` and `as_tibble()` over `data_frame()` and `as_data_frame()` in code and documentation (#82). 731- New `is.tibble()` and `is_tibble()` (#79). 732- New `enframe()` that converts vectors to two-column tibbles (#31, #74). 733- `obj_sum()` and `type_sum()` show `"tibble"` instead of `"tbl_df"` for tibbles (#82). 734- `as_tibble.data.frame()` gains `validate` argument (as in `as_tibble.list()`), if `TRUE` the input is validated. 735- Implement `as_tibble.default()` (#71, hadley/dplyr#1752). 736- `has_rownames()` supports arguments that are not data frames. 737 738 739## Bug fixes 740 741- Two-dimensional indexing with `[[` works (#58, #63). 742- Subsetting with empty index (e.g., `x[]`) also removes row names. 743 744 745## Documentation 746 747- Document behavior of `as_tibble.tbl_df()` for subclasses (#60). 748- Document and test that subsetting removes row names. 749 750 751## Internal 752 753- Don't rely on `knitr` internals for testing (#78). 754- Fix compatibility with `knitr` 1.13 (#76). 755- Enhance `knit_print()` tests. 756- Provide default implementation for `tbl_sum.tbl_sql()` and `tbl_sum.tbl_grouped_df()` to allow `dplyr` release before a `tibble` release. 757- Explicit tests for `format_v()` (#98). 758- Test output for `NULL` value of `tbl_sum()`. 759- Test subsetting in all variants (#62). 760- Add missing test from dplyr. 761- Use new `expect_output_file()` from `testthat`. 762 763 764# Version 1.0 765 766- Initial CRAN release 767 768- Extracted from `dplyr` 0.4.3 769 770- Exported functions: 771 - `tbl_df()` 772 - `as_data_frame()` 773 - `data_frame()`, `data_frame_()` 774 - `frame_data()`, `tibble()` 775 - `glimpse()` 776 - `trunc_mat()`, `knit_print.trunc_mat()` 777 - `type_sum()` 778 - New `lst()` and `lst_()` create lists in the same way that 779 `data_frame()` and `data_frame_()` create data frames (hadley/dplyr#1290). 780 `lst(NULL)` doesn't raise an error (#17, @jennybc), but always 781 uses deparsed expression as name (even for `NULL`). 782 - New `add_row()` makes it easy to add a new row to data frame 783 (hadley/dplyr#1021). 784 - New `rownames_to_column()` and `column_to_rownames()` (#11, @zhilongjia). 785 - New `has_rownames()` and `remove_rownames()` (#44). 786 - New `repair_names()` fixes missing and duplicate names (#10, #15, 787 @r2evans). 788 - New `is_vector_s3()`. 789 790- Features 791 - New `as_data_frame.table()` with argument `n` to control name of count 792 column (#22, #23). 793 - Use `tibble` prefix for options (#13, #36). 794 - `glimpse()` now (invisibly) returns its argument (hadley/dplyr#1570). It 795 is now a generic, the default method dispatches to `str()` 796 (hadley/dplyr#1325). The default width is obtained from the 797 `tibble.width` option (#35, #56). 798 - `as_data_frame()` is now an S3 generic with methods for lists (the old 799 `as_data_frame()`), data frames (trivial), matrices (with efficient 800 C++ implementation) (hadley/dplyr#876), and `NULL` (returns a 0-row 801 0-column data frame) (#17, @jennybc). 802 - Non-scalar input to `frame_data()` and `tibble()` (including lists) 803 creates list-valued columns (#7). These functions return 0-row but n-col 804 data frame if no data. 805 806- Bug fixes 807 - `frame_data()` properly constructs rectangular tables (hadley/dplyr#1377, 808 @kevinushey). 809 810- Minor modifications 811 - Uses `setOldClass(c("tbl_df", "tbl", "data.frame"))` to help with S4 812 (hadley/dplyr#969). 813 - `tbl_df()` automatically generates column names (hadley/dplyr#1606). 814 - `tbl_df`s gain `$` and `[[` methods that are ~5x faster than the defaults, 815 never do partial matching (hadley/dplyr#1504), and throw an error if the 816 variable does not exist. `[[.tbl_df()` falls back to regular subsetting 817 when used with anything other than a single string (#29). 818 `base::getElement()` now works with tibbles (#9). 819 - `all_equal()` allows to compare data frames ignoring row and column order, 820 and optionally ignoring minor differences in type (e.g. int vs. double) 821 (hadley/dplyr#821). Used by `all.equal()` for tibbles. (This package 822 contains a pure R implementation of `all_equal()`, the `dplyr` code has 823 identical behavior but is written in C++ and thus faster.) 824 - The internals of `data_frame()` and `as_data_frame()` have been aligned, 825 so `as_data_frame()` will now automatically recycle length-1 vectors. 826 Both functions give more informative error messages if you are attempting 827 to create an invalid data frame. You can no longer create a data frame 828 with duplicated names (hadley/dplyr#820). Both functions now check that 829 you don't have any `POSIXlt` columns, and tell you to use `POSIXct` if you 830 do (hadley/dplyr#813). `data_frame(NULL)` raises error "must be a 1d 831 atomic vector or list". 832 - `trunc_mat()` and `print.tbl_df()` are considerably faster if you have 833 very wide data frames. They will now also only list the first 100 834 additional variables not already on screen - control this with the new 835 `n_extra` parameter to `print()` (hadley/dplyr#1161). The type of list 836 columns is printed correctly (hadley/dplyr#1379). The `width` argument is 837 used also for 0-row or 0-column data frames (#18). 838 - When used in list-columns, S4 objects only print the class name rather 839 than the full class hierarchy (#33). 840 - Add test that `[.tbl_df()` does not change class (#41, @jennybc). Improve 841 `[.tbl_df()` error message. 842 843- Documentation 844 - Update README, with edits (#52, @bhive01) and enhancements (#54, 845 @jennybc). 846 - `vignette("tibble")` describes the difference between tbl_dfs and 847 regular data frames (hadley/dplyr#1468). 848 849- Code quality 850 - Test using new-style Travis-CI and AppVeyor. Full test coverage (#24, 851 #53). Regression tests load known output from file (#49). 852 - Renamed `obj_type()` to `obj_sum()`, improvements, better integration with 853 `type_sum()`. 854 - Internal cleanup. 855