Skip to content

Releases: tidyverse/tibble

tibble 3.1.0

25 Feb 17:34
Compare
Choose a tag to compare

Bug fixes

  • has_rownames() now works correctly for data frames with a "row.names" attribute malformed due to a problem in structure() (#852).

  • tbl[FALSE, "column"] <- x adds new column again (#846).

Features

  • 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_repair argument in the error message (#839).

Internal

  • Remove compatibility code for pillar < 1.5.0 (#861).

  • Moved most functions to the "stable" lifecycle (#860).

tibble 3.0.6

30 Jan 03:56
Compare
Choose a tag to compare
  • vec_ptype_abbr.tbl_df() and type_sum.tbl_df() now uses the name of the topmost class for subclasses of "tbl_df" (#843).
  • Ignore errors in formats.Rmd vignette.
  • Avoid tidy evaluation in pillar compatibility code.

tibble 3.0.5

27 Jan 04:52
Compare
Choose a tag to compare
  • Use testthat edition 3, compatible with testthat 3.0.1 (#827, #832).

tibble 3.0.4

15 Oct 07:09
Compare
Choose a tag to compare

Compatibility

  • Establish compatibility with upcoming pillar 1.5.0 (#818).

  • tbl_sum() shows "data frame" instead of "tibble" for objects inheriting from "tbl" but not "tbl_df" (#818).

  • Register format.tbl() and print.tbl() methods only if pillar doesn't (#816).

  • Use vctrs::num_as_location() internally for subset assignment of rows and columns for better error messages (#746).

  • Adapt tests to the development version of testthat.

Bug fixes

  • Fix documentation link to base::Extract.

  • add_row(df) adds an empty row again (#809, @DavisVaughan).

tibble 3.0.3

12 Jul 02:05
Compare
Choose a tag to compare
  • Fix test compatibility with rlang 0.4.7.

  • Fix warning about needs_dots arguments with pillar >= 1.4.5 (#798).

tibble 3.0.2

09 Jul 19:16
Compare
Choose a tag to compare

Bug fixes

  • [[ works with classed indexes again, e.g. created with glue::glue() (#778).
  • add_column() works without warning for 0-column data frames (#786).
  • tribble() now better handles named inputs (#775) and objects of non-vtrs classes like lubridate::Period (#784) and formattable::formattable (#785).

Performance

  • Subsetting and subassignment are faster (#780, #790, #794).
  • is.null() is preferred over is_null() for speed.
  • Implement continuous benchmarking (#793).

Compatibility

  • is_vector_s3() is no longer reexported from pillar (#789).

tibble 3.0.1

20 Apr 09:13
Compare
Choose a tag to compare

Compatibility fixes

  • [<-.tbl_df() coerces matrices to data frames (#762).

  • Use delayed import for cli to work around unload problems in downstream packages (#754).

Bug fixes

  • More soft-deprecation warnings are actually visible.

  • If .name_repair is a function, no repair messages are shown (#763).

  • Remove superseded signal for as_tibble.list(), because as_tibble_row() only works for size 1.

Enhancements

  • as_tibble(validate = ) now always triggers a deprecation warning.

  • Subsetting and subassignment of rows with one-column matrices work again, with a deprecation warning (#760).

  • 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.

  • Tweak title of "Invariants" vignette.

tibble 3.0.0

19 Apr 18:44
Compare
Choose a tag to compare

Major breaking changes

  • Subset assignment ("subassignment") and also subsetting has become 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 at 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.

  • 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 to include "list" in the class:

    structure(x, class = c("your_s3_class", "list"))

    Alternatively, implement a vec_proxy() method as described in vctrs.r-lib.org/reference/vec_data.html, or construct your class with list_of().

  • 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:

    • "names for target but not for current" when comparing

Breaking changes

  • tibble() now splices anonymous data frames, tibble(tibble(a = 1), b = a) is equivalent to tibble(a = 1, b = a). This means that tibble(iris) now has five columns, use tibble(iris = iris) if the intention is to create a packed data frame (#581).

  • The name-repair help topic is gone, refer to ?vctrs::vec_as_names instead.

  • expression() columns are converted to lists as a workaround for lacking support in vctrs (#657).

  • 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.

  • $ warns unconditionally if column not found, [[ doesn't warn.

  • 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.

Soft deprecations

  • Soft-deprecate subclass argument to new_tibble().

  • Soft-deprecate as_tibble() without arguments (#683).

  • 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.

Features

  • 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).

  • 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.

    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.

    Use the following pattern to catch errors emitted by tibble:

    tryCatch(
      your_code(),
      tibble_error = function(cnd) {
        ...
      }
    )
  • 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).

  • 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).

  • 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).

  • Implement str.tbl_df() (#480).

  • tribble() now returns columns with "unspecified" type for 0-row tibbles.

  • add_row() and add_column() now restore attributes to avoid errors when appending to sf objects or other tibble subclasses (#662).

  • add_column() gains .name_repair argument. If not given, .data must have unique columns, with a deprecation message.

  • Allow POSIXlt columns, they are now better supported by dplyr and other tools thanks to vctrs (#626).

  • tibble() ignores NULL arguments, named or unnamed (#580).

  • 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).

Output

  • Formatting dimensions never uses scientific notation.

  • glimpse() uses "Rows" and "Columns" instead of "Variables" and "Observations", because we're not sure if the data is tidy here (#614).

  • view() now uses the created (or passed) title argument (#610, @xvrdm).

Performance

Internal

  • 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.

tibble 2.1.3

13 Jun 12:39
Compare
Choose a tag to compare
  • Fix compatibility with R 3.5 and earlier, regression introduced in tibble 2.1.2.

tibble 2.1.2

30 May 19:41
Compare
Choose a tag to compare
  • Relax version requirements.
  • Fix test failing after pillar upgrade.