title: Generate a dummy-variable
body: <p>I have had trouble generating the following dummy-variables in R:</p>
  <p>I'm analyzing yearly time series data (time period 1948-2009). I have two questions:</p>
  <ol>
  <li><p>How do I generate a dummy variable for observation #10, i.e. for year 1957 (value = 1 at 1957 and zero otherwise)?</p>
  </li>
  <li><p>How do I generate a dummy variable which is zero before 1957 and takes the value 1 from 1957 and onwards to 2009?</p>
  </li>
  </ol>