Closed ethanbsmith closed 1 year ago
Actually, I don't think this is a bug or unintended behavior. Those functions still work as intended. The "problem" is that the results are auto-printed, which calls print.xts()
automatically. And 40 is the default number of rows to truncate. There's no easy way for print.xts()
to know what call immediately preceded it.
The solution will be to set the yet-to-be-named option to a value you prefer. I chose 40 because that's roughly what fits on my laptop screen. data.table uses 100. I'm open to suggestions for the default vaule.
didnt mean to imply it broke these functions directly. just that the effective behavior was different
tail(x, 101)
anything between 55-100 for default would be my suggestion.
From: Joshua Ulrich @.> Sent: Monday, January 30, 2023 2:31 PM To: joshuaulrich/xts @.> Cc: Ethan Smith @.>; Author @.> Subject: Re: [joshuaulrich/xts] new print() formatting breaks first/last default behavior (Issue #388)
Actually, I don't think this is a bug or unintended behavior. Those functions still work as intended. The "problem" is that the results are auto-printed, which calls print.xts() automatically. And 40 is the default number of rows to truncate. There's no easy way for print.xts() to know what call immediately preceded it.
The solution will be to set the yet-to-be-named option to a value you prefer. I chose 40 because that's roughly what fits on my laptop screen. data.table uses 100. I'm open to suggestions for the default vaule.
— Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjoshuaulrich%2Fxts%2Fissues%2F388%23issuecomment-1409371417&data=05%7C01%7C%7Ccaf1a9b91c2a4673c18308db03095af0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638107110937715068%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OLLDZWAYQ4KzIy%2FeKSa41QEvZemFghmDtvoC2dtlgIE%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAF2ACBYN75R57KA2SFBHXZLWVAXLHANCNFSM6AAAAAAUJ2GRUY&data=05%7C01%7C%7Ccaf1a9b91c2a4673c18308db03095af0%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638107110937715068%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1p7mZ64gyIfr%2FbTo%2FFLE9OYIQrnUw7ib1PVl5rYdU6U%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>
I bumped the default to 100 and added a global option to control it (in 701f4de28a1ed8165bb7ac89e81a2235fcb49737).
Description
feature #321 has changed the behavior of
head()
andtail()
forn >= 42
. instead of printing exactly n rows, it truncates the output to just a few of the first and last rows, with an...
in between. This also happens withfirst()
andlast()
.i suspect this affects other output scenarios where explicit subsetting produced more than 42 rows, though not sure how common that use case is.
Expected behavior
first and last should print exactly n rows
Minimal, reproducible example
Session Info