Skip to content
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

knitr / printr prints out whole table when update by reference is used #1326

Closed
ghost opened this issue Sep 11, 2015 · 3 comments
Closed

knitr / printr prints out whole table when update by reference is used #1326

ghost opened this issue Sep 11, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 11, 2015

library(data.table)

data(mtcars)
df = data.table(mtcars)

library printr: https://github.com/yihui/printr

has issue with data.table.

this works in data.table 1.9.5, no intention to print/head table:

df[, mpg2 := mpg * 2]

but after loading printr, update by reference prints out the whole table.

the same thing happens without loading printr in data.table 1.9.4.

library(printr)
df[, mpg3 := mpg2 / 2]

the [verbose] solution for the moment:

# in data.table 1.9.4 even without printr OR
# in data.table 1.9.5 with printr:
df = df[, mpg4 := mpg3 * 2]

# doesn't print out the whole table
sessionInfo()

R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=nl_NL.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=nl_NL.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=nl_NL.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=nl_NL.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] printr_0.0.4 data.table_1.9.5

loaded via a namespace (and not attached):
[1] chron_2.3-47 digest_0.6.8 evaluate_0.7.2 highr_0.5
[5] htmltools_0.2.6 knitr_1.11 magrittr_1.5 rmarkdown_0.7
[9] stringi_0.5-5 stringr_1.0.0 tools_3.1.2 yaml_2.1.13

@arunsrinivasan
Copy link
Member

printr doesn't seem to be on CRAN. Is this reproducible using 1.9.7 with knitr as well?

@ghost
Copy link
Author

ghost commented Oct 7, 2015

yes, same issue on 1.9.6 and 1.9.7.
printr is on github, see link above; library printr: https://github.com/yihui/printr, and is prints nice tables in markdown. check http://yihui.name/printr/.

@mattdowle mattdowle added this to the v1.10.6 milestone Feb 1, 2017
@mattdowle mattdowle modified the milestones: v1.10.6, Candidate Mar 30, 2018
@mattdowle mattdowle removed this from the Candidate milestone May 10, 2018
@jangorecki
Copy link
Member

Not able to reproduce on recent master and printr 0.1 from CRAN. Please report if it is still an issue for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants