title: How to create an time series in R for the .data format?
body: <p>I´m having some difficulties to read and create an time series objects in R for this datasets:</p>
  <p>SOI: <a href="https://psl.noaa.gov/data/correlation/soi.data" rel="nofollow noreferrer">https://psl.noaa.gov/data/correlation/soi.data</a>
  ONI: <a href="https://psl.noaa.gov/data/correlation/oni.data" rel="nofollow noreferrer">https://psl.noaa.gov/data/correlation/oni.data</a></p>
  <p>By seen the data we have in the first column the years and in the cols the months (Jan to Dec)</p>
  <p>I expect to have something like this for SOI in R:</p>
  <pre><code>YearMonth  SOI
    &lt;mth&gt;    &lt;dbl&gt;
  Jan 1948   -99.99
  Feb 1948   -99.99
  ...         ...
  Sep 2021   -1.3
  Oct 2021   -99.99
  Nov 2021   -99.99
  Dec 2021   -99.99
  </code></pre>
  <p>And in the same way for ONI:</p>
  <pre><code>YearMonth  ONI
    &lt;mth&gt;    &lt;dbl&gt;
  Jan 1950   -1.53
  Feb 1950   -1.34
  ...         ...
  Aug 2021   -0.46
  Sep 2021   -99.90
  Oct 2021   -99.90
  Nov 2021   -99.90
  Dec 2021   -99.90
  </code></pre>
  <p>I believe that the arrangement of this dataset may be the source of my difficulty, as I am not being able to correctly pivot this data.</p>
  <p>I know that here in the stack we have good R users that will definitely help me with the best practice.</p>