title: How to select time range during weekdays and associated data on the next column
body: <p>Here is an example of a subset data in .csv files. There are three columns with no header. The first column represents the date/time and the second column is load [kw] and the third column is 1= weekday, 0 = weekends/ holiday.</p>
  
  <pre><code>9/9/2010 3:00   153.94  1
  9/9/2010 3:15   148.46  1
  </code></pre>
  
  <p>I would like to program in R, so that it selects the first and second column within time ranges from 10:00 to 20:00 for all weekdays (when the third column is 1) within a month of September and do not know what's the best and most efficient way to code.  </p>
  
  <pre><code>code dt &lt;- read.csv("file", header = F, sep=",") 
  
  #Select a column with weekday designation = 1, weekend or holiday = 0 
  
  y &lt;- data.frame(dt[,3]) 
  
  #Select a column with timestamps and loads 
  
  x &lt;- data.frame(dt[,1:2]) 
  t &lt;- data.frame(dt[,1]) 
  
  #convert timestamps into readable format 
  
  s &lt;- strptime("9/1/2010 0:00", format="%m/%d/%Y %H:%M") 
  e &lt;- strptime("9/30/2010 23:45", format="%m/%d/%Y %H:%M") 
  range &lt;- seq(s,e, by = "min") 
  df &lt;- data.frame(range)
  </code></pre>