New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore options(max.print)? #194

Closed
t-kalinowski opened this Issue Nov 17, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@t-kalinowski

t-kalinowski commented Nov 17, 2016

Would it be possible to have the tibbles print method ignore the "main" max.print option, and only respect the tibble specific options?

  options(max.print = 100)
  options(tibble.print_max = 50, tibble.print_min = 30)
data_frame(x = 1:60, y = x, z = x, xyz = x)

gives

# A tibble: 60 × 4
       x     y     z   xyz
   <int> <int> <int> <int>
1      1     1     1     1
2      2     2     2     2
3      3     3     3     3
4      4     4     4     4
5      5     5     5     5
6      6     6     6     6
7      7     7     7     7
8      8     8     8     8
9      9     9     9     9
10    10    10    10    10
11    11    11    11    11
12    12    12    12    12
13    13    13    13    13
14    14    14    14    14
15    15    15    15    15
16    16    16    16    16
17    17    17    17    17
18    18    18    18    18
19    19    19    19    19
20    20    20    20    20
21    21    21    21    21
22    22    22    22    22
23    23    23    23    23
24    24    24    24    24
 [ reached getOption("max.print") -- omitted 6 rows ]
# ... with 30 more rows
@krlmlr

This comment has been minimized.

Member

krlmlr commented Nov 17, 2016

This sounds reasonable. We can temporarily set options(max.print) to a value large enough. Would you like to submit a PR?

@t-kalinowski

This comment has been minimized.

t-kalinowski commented Nov 17, 2016

Sure, I'll put something together later in the week.
are you imagining that within the print method we'd use something like
options(max.print = Inf) and on.exit(options(max.print = original_max.print_option))?

@krlmlr

This comment has been minimized.

Member

krlmlr commented Nov 17, 2016

Yes, only you can't use Inf, needs to be an integer; I also prefer on.exit(..., add = TRUE) .

@t-kalinowski

This comment has been minimized.

t-kalinowski commented Nov 18, 2016

would you prefer this inside print.trunc_mat or print.tbl_df

@krlmlr

This comment has been minimized.

Member

krlmlr commented Nov 18, 2016

I don't know -- what are the implications?

@krlmlr krlmlr closed this in #195 Nov 18, 2016

krlmlr added a commit that referenced this issue Nov 18, 2016

Merge pull request #195 from t-kalinowski/max.print-options
- The `max.print` option is ignored when printing a tibble (#194, #195, @t-kalinowski).

krlmlr added a commit that referenced this issue Nov 30, 2016

Merge tag 'v1.2-13'
- New `frame_matrix()` (#140, #168, @LaDilettante).
- The `max.print` option is ignored when printing a tibble (#194, #195, @t-kalinowski).
- Fix typo in `obj_sum` documentation (#193, @etiennebr).
- Keep column classes when adding row to empty tibble (#171, #177, @LaDilettante).
- Now explicitly stating minimum Rcpp version 0.12.3.

krlmlr added a commit that referenced this issue Apr 1, 2017

Merge tag 'v1.3.0'
Bug fixes
=========

- Time series matrices (objects of class `mts` and `ts`) are now supported in `as_tibble()` (#184).
- 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).

Interface changes
=================

- Now requiring R 3.1.0 instead of R 3.1.3 (#189).
- Add `as.tibble()` as an alias to `as_tibble()` (#160, @LaDilettante).
- New `frame_matrix()`, similar to `frame_data()` but for matrices (#140, #168, @LaDilettante).
- New `deframe()` as reverse operation to `enframe()` (#146, #214).
- Removed unused dependency on `assertthat`.

Features
========

General
-------

- Keep column classes when adding row to empty tibble (#171, #177, @LaDilettante).
- Singular and plural variants for error messages that mention a list of objects (#116, #138, @LaDilettante).
- `add_column()` can add columns of length 1 (#162, #164, @LaDilettante).

Input validation
----------------

- An attempt to read or update a missing column now throws a clearer warning (#199).
- An attempt to call `add_row()` for a grouped data frame results in a helpful error message (#179).

Printing
--------

- Render Unicode multiplication sign as `x` if it cannot be represented in the current locale (#192, @ncarchedi).
- Backtick `NA` names in printing (#206, #207, @jennybc).
- `glimpse()` now uses `type_sum()` also for S3 objects (#185, #186, @holstius).
- The `max.print` option is ignored when printing a tibble (#194, #195, @t-kalinowski).

Documentation
=============

- Fix typo in `obj_sum` documentation (#193, @etiennebr).
- Reword documentation for `tribble()` (#191, @kwstat).
- Now explicitly stating minimum Rcpp version 0.12.3.

Internal
========

- Using registration of native routines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment