title: How to get hourly data values stored in a data frame that is used to derive another data frame composed of its week no
body: <p>#hourlydataset in mz matrix</p>
  <p>##then I created another data frame of daily values
  further, I am trying to read the daily value data frame in rows and storing the 24 hours values based on 'did'</p>
  <pre><code> for (i in 1:length(id3)) {
    idfinal2&lt;-id3[i]
    yrn&lt;-df2[idfinal2,1]
    wkn&lt;-df2[idfinal2,2]
    did&lt;-(((yrn-1))*8760)+(wkn*24)
    dtk&lt;-mz[(did+1):(did+24),ensm]
    hrdat&lt;-rbind(hrdat,dtk)
  }
  </code></pre>
  <p>#it is giving NAn error at wkn but reading yrn fine!</p>