0

How to view the data-frame properly?

Here are lines to load the data-frame chicken from the astsa package. The object chicken contains monthly figures.

library(astsa)
data("chicken", package = "astsa")

When I execute this line, it only shows a single column numbers, which doesn't look like the data-frame.

View(chicken)

Am I not reading the right data-set? If so, how can I read it correctly? Thank you!

Mark K
  • 8,767
  • 14
  • 58
  • 118
  • 3
    I don't have the package, but my spidey-senses suggest to me that `chicken` is a `ts` time-series object, which is just a one-dimensional vector with some labels that only appear when printed. – thelatemail Aug 07 '18 at 03:16
  • @thelatemail, thank you for the common. Is there a way that I can view/export as a time-series object? I want to look at the dates. – Mark K Aug 07 '18 at 03:17
  • 1
    Just type `chicken` in your R console - or `print(chicken)` and you should be able to visually check it in a month-by-month grid. – thelatemail Aug 07 '18 at 03:19
  • @thelatemail, thanks! so copy from the console and paste it into Excel looks like the best solution... – Mark K Aug 07 '18 at 03:23
  • 1
    There is an ugly function which you can call for visual inspection/export without relying on copy-and-paste `.preformat.ts(chicken)` , which you could then export directly. – thelatemail Aug 07 '18 at 03:30
  • @thelatemail, could you please post it as an answer? :) – Mark K Aug 07 '18 at 03:31

0 Answers0