-
Notifications
You must be signed in to change notification settings - Fork 65
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
Seemingly a bug in justify= and rownames=1:nrow() #339
Comments
Thanks for the report -- this seems to be more of an issue with splitting tables, as the below works: > pander(tmpDF[, 1:3], justify = rep('right', 4), row.names = 1:nrow(tmpDF))
-------------------------------------------------------
companyid nRowsDat nUsers
-------- -------------------------- ---------- --------
**1** 5be03792e60b662819bb2068 7429 57
**2** 5be071e44f07bccdf1601d0e 7742 70
**3** 5be069ddc5ad8b5d83c1a453 2829 15
**4** 5c5d5d3f65c8f7daf974b770 448 4
**5** 5c7e670b08263a276d43198d 302 2
**6** 5c8f873bb34f572ae12bd0b3 1994 23
**7** 5c8fccf2bf6843025d207058 827 12
**8** 5ca1b137e4e8ee864f9c8152 1634 14
**9** 5ca1fd523115bd8cf834fe7d 441 4
**10** 5cab31b0bacb74464a4cba4e 18 1
-------------------------------------------------------
> pander(tmpDF, justify = 'rrrrrrr', row.names = 1:nrow(tmpDF), split.table = Inf)
----------------------------------------------------------------------------------------------
companyid nRowsDat nUsers firstDate lastDate daysInData
-------- -------------------------- ---------- -------- ------------ ------------ ------------
**1** 5be03792e60b662819bb2068 7429 57 2018-09-06 2019-04-14 220
**2** 5be071e44f07bccdf1601d0e 7742 70 2018-09-06 2019-04-08 214
**3** 5be069ddc5ad8b5d83c1a453 2829 15 2018-11-08 2019-02-06 90
**4** 5c5d5d3f65c8f7daf974b770 448 4 2019-02-25 2019-03-06 9
**5** 5c7e670b08263a276d43198d 302 2 2019-03-05 2019-04-02 28
**6** 5c8f873bb34f572ae12bd0b3 1994 23 2019-03-18 2019-04-14 27
**7** 5c8fccf2bf6843025d207058 827 12 2019-03-26 2019-04-13 18
**8** 5ca1b137e4e8ee864f9c8152 1634 14 2019-04-01 2019-04-14 13
**9** 5ca1fd523115bd8cf834fe7d 441 4 2019-04-01 2019-04-13 12
**10** 5cab31b0bacb74464a4cba4e 18 1 2019-04-08 2019-04-08 0
---------------------------------------------------------------------------------------------- Will look into this more later. |
Interesting, I hadn't tried that on this table nor noticed it with others and I use split.tables = Inf quite a bit but I guess I rarely find myself imposing the 1:nrow() row names.
Really appreciate you looking into it Gergely. I of course bodged things by cbinding in a column for the 1:nrow() labels on the left.
I'd definitely lobby for my feature request of the "row.names = TRUE" option too but that's in my other submission!
Many thanks again,
Chris
… From: "Gergely Daróczi" ***@***.***>
To: "Rapporter/pander" ***@***.***>
Cc: "cpsyctc2" ***@***.***>, "Author" ***@***.***>
Sent: Tuesday, 16 April, 2019 00:14:38
Subject: Re: [Rapporter/pander] Seemingly a bug in justify= and
rownames=1:nrow() (#339)
Thanks for the report -- this seems to be more of an issue with splitting
tables, as the below works:
> pander( tmpDF [, 1 : 3 ], justify = rep( ' right ' , 4 ), row.names = 1 : nrow(
> tmpDF )) ------------------------------------------------------- & nbsp ;
> companyid nRowsDat nUsers -------- -------------------------- ----------
> -------- ** 1 ** 5be03792e60b662819bb2068 7429 57 ** 2 **
> 5be071e44f07bccdf1601d0e 7742 70 ** 3 ** 5be069ddc5ad8b5d83c1a453 2829 15 ** 4
> ** 5c5d5d3f65c8f7daf974b770 448 4 ** 5 ** 5c7e670b08263a276d43198d 302 2 ** 6
> ** 5c8f873bb34f572ae12bd0b3 1994 23 ** 7 ** 5c8fccf2bf6843025d207058 827 12 **
> 8 ** 5ca1b137e4e8ee864f9c8152 1634 14 ** 9 ** 5ca1fd523115bd8cf834fe7d 441 4 **
> 10 ** 5cab31b0bacb74464a4cba4e 18 1
> ------------------------------------------------------- > pander( tmpDF ,
> justify = ' rrrrrrr ' , row.names = 1 : nrow( tmpDF ), split.table = Inf )
> ----------------------------------------------------------------------------------------------
> & nbsp ; companyid nRowsDat nUsers firstDate lastDate daysInData --------
> -------------------------- ---------- -------- ------------ ------------
> ------------ ** 1 ** 5be03792e60b662819bb2068 7429 57 2018 - 09 - 06 2019 - 04
> - 14 220 ** 2 ** 5be071e44f07bccdf1601d0e 7742 70 2018 - 09 - 06 2019 - 04 - 08
> 214 ** 3 ** 5be069ddc5ad8b5d83c1a453 2829 15 2018 - 11 - 08 2019 - 02 - 06 90
> ** 4 ** 5c5d5d3f65c8f7daf974b770 448 4 2019 - 02 - 25 2019 - 03 - 06 9 ** 5 **
> 5c7e670b08263a276d43198d 302 2 2019 - 03 - 05 2019 - 04 - 02 28 ** 6 **
> 5c8f873bb34f572ae12bd0b3 1994 23 2019 - 03 - 18 2019 - 04 - 14 27 ** 7 **
> 5c8fccf2bf6843025d207058 827 12 2019 - 03 - 26 2019 - 04 - 13 18 ** 8 **
> 5ca1b137e4e8ee864f9c8152 1634 14 2019 - 04 - 01 2019 - 04 - 14 13 ** 9 **
> 5ca1fd523115bd8cf834fe7d 441 4 2019 - 04 - 01 2019 - 04 - 13 12 ** 10 **
> 5cab31b0bacb74464a4cba4e 18 1 2019 - 04 - 08 2019 - 04 - 08 0
> ----------------------------------------------------------------------------------------------
Will look into this more later.
—
You are receiving this because you authored the thread.
Reply to this email directly, [
#339 (comment) | view it
on GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/AukAkkqpsenDcBZGLFXQxn_fwyadr9Ovks5vhPnOgaJpZM4cwkxF
| mute the thread ] .
--
Chris Evans <chris@psyctc.org> Skype: chris-psyctc
Visiting Professor, University of Sheffield <chris.evans@sheffield.ac.uk>
I do some consultation work for the University of Roehampton <chris.evans@roehampton.ac.uk> and other places but this <chris@psyctc.org> remains my main Email address.
I have "semigrated" to France, see: https://www.psyctc.org/pelerinage2016/semigrating-to-france/ if you want to book to talk, I am trying to keep that to Thursdays and my diary is now available at: https://www.psyctc.org/pelerinage2016/ecwd_calendar/calendar/
Beware: French time, generally an hour ahead of UK. That page will also take you to my blog which started with earlier joys in France and Spain!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use pander a lot for tables in Rmarkdown generated from Rstudio so many thanks for the package.
Here's a reproducible example I think. It may be a bit of an edge case as I do want row names when they are 1:nrow(tmpDF)
but
Which is correct, as it is that
pander(tmpDF, justify = "lrrllr")
works correctly.
I hope I'm not missing something. TIA, Chris
The text was updated successfully, but these errors were encountered: