joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
219 stars 71 forks source link

Column prints too wide when 1-column object doesn't have column names #390

Closed joshuaulrich closed 1 year ago

joshuaulrich commented 1 year ago
R$ xts::.xts(1:10, 1:10)
                                        [,1]
1969-12-31 18:00:01                        1
1969-12-31 18:00:02                        2
1969-12-31 18:00:03                        3
1969-12-31 18:00:04                        4
1969-12-31 18:00:05                        5
1969-12-31 18:00:06                        6
1969-12-31 18:00:07                        7
1969-12-31 18:00:08                        8
1969-12-31 18:00:09                        9
1969-12-31 18:00:10                       10

### okay if column names exist
R$ xts::.xts(1:10, 1:10, dimnames = list(NULL, "hi"))
                    hi
1969-12-31 18:00:01  1
1969-12-31 18:00:02  2
1969-12-31 18:00:03  3
1969-12-31 18:00:04  4
1969-12-31 18:00:05  5
1969-12-31 18:00:06  6
1969-12-31 18:00:07  7
1969-12-31 18:00:08  8
1969-12-31 18:00:09  9
1969-12-31 18:00:10 10

### okay if no column names on multi-column object
R$ xts::.xts(cbind(1:10, 1:10), 1:10)
                      [,1]  [,2]
1969-12-31 18:00:01      1     1
1969-12-31 18:00:02      2     2
1969-12-31 18:00:03      3     3
1969-12-31 18:00:04      4     4
1969-12-31 18:00:05      5     5
1969-12-31 18:00:06      6     6
1969-12-31 18:00:07      7     7
1969-12-31 18:00:08      8     8
1969-12-31 18:00:09      9     9
1969-12-31 18:00:10     10    10