title: "invalid time series parameters specified" error in R
body: <p>I am trying to modify the Nelson/Siegel example from the YieldCurve documentation using data from the USTYC package (<a href="https://cran.r-project.org/web/packages/YieldCurve/YieldCurve.pdf" rel="nofollow noreferrer">https://cran.r-project.org/web/packages/YieldCurve/YieldCurve.pdf</a>).</p>
  
  <p>The original code is:</p>
  
  <pre><code>library(YieldCurve)
  
  ### Nelson.Siegel function and Fed data-set ###
  data(FedYieldCurve)
  rate.Fed = first(FedYieldCurve,'5 month')
  maturity.Fed &lt;- c(3/12, 0.5, 1,2,3,5,7,10)
  NSParameters &lt;- Nelson.Siegel( rate= rate.Fed, maturity=maturity.Fed )
  y &lt;- NSrates(NSParameters[5,], maturity.Fed)
  </code></pre>
  
  <p>My modified code is below</p>
  
  <pre><code>library(ustyc)
  library(YieldCurve)
  xlist = getYieldCurve() # 2.5 mins
  
  yields &lt;- xlist$df
  maturities &lt;- c(1/12, 3/12, 6/12, 1, 2, 3, 5, 7, 10, 20, 30)
  curve &lt;- yields["2018-05-21",1:11]
  NSParameters &lt;- Nelson.Siegel(curve,maturities)
  y &lt;- NSrates(NSParameters[1,],maturities)
  </code></pre>
  
  <p>However, I am getting the error:</p>
  
  <blockquote>
    <p>Error in attr(x, "tsp") &lt;- c(1, NROW(x), 1) : 
         invalid time series parameters specified</p>
  </blockquote>
  
  <p>What am I doing wrong? Thanks in advance</p>