You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error printing short ts objects in a Jupyter notebook #134
When using a Jupyter notebook with R kernel in CoCalc to print out a ts object, I got this error
ERROR while rich displaying an object: Error in arr_partition(a, rows, cols): rows >= 2L is not TRUE
The error occurs when printing a ts object where all observations are in the same year. To replicate in a notebook:
# This works fine because two rows of output
ts(rnorm(13), start=c(2000,1), frequency=12)
# This fails because only one row of output
ts(rnorm(12), start=c(2000,1), frequency=12)
# Wrapping in a print statement works, but that's because it's dumping the R output directly to the screen rather than formatting it
print(ts(rnorm(12), start=c(2000,1), frequency=12))
It looks like the message is triggered by this line, which imposes the requirement that the ts object has to have two rows:
Ah right, those parameters are supposed to control the max number of rows/cols that are displayed before ellipses (…) indicate omission. Time series should always fully display, so I overrode the max number of rows/cols to be the actual number there, forgetting that the ellipsis code can’t handle that.
Activity
flying-sheep commentedon Sep 6, 2020
Ah right, those parameters are supposed to control the max number of rows/cols that are displayed before ellipses (…) indicate omission. Time series should always fully display, so I overrode the max number of rows/cols to be the actual number there, forgetting that the ellipsis code can’t handle that.