title: Error in dataprep function of Synth package - treated unit not found in unit.variable
body: <p>I'm using the Synth package to evaluate the effect of a policy - Synthetic Control.
  However, when using the dataprep function in R it gives an error:</p>
  <blockquote>
  <p>Error in dataprep(foo = general_data, predictors = c(&quot;PROD_PEC&quot;, &quot;CONSU_FERT&quot;, :</p>
  </blockquote>
  <p>treated unit not found in unit.variable.</p>
  <p>Follow all the steps of Abadie's original model.</p>
  <p>Example:</p>
  <pre><code>dataprep.out &lt;- dataprep(foo = dados_gerais,
    predictors = c(&quot;PROD_PEC&quot;, &quot;CONSU_FERT&quot;, &quot;AGROTOXICO&quot;, &quot;TERRAS_AGRICOLAS&quot;, 
                   &quot;CARBONO_FLORESTAL&quot;, &quot;CHUVAS&quot;,  &quot;TEMPERATURA&quot;, 
                   &quot;MAO_DE_OBRA&quot;, &quot;CAPITAL_HUMANO&quot;),
    predictors.op = &quot;mean&quot;,
    time.predictors.prior = 1991:2009,
    special.predictors = list(
      list(&quot;VBP_AGRO_CO2_EQ&quot;, 1991:2009 , &quot;mean&quot;),
      list(&quot;PROD_PEC&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;CONSU_FERT&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;AGROTOXICO&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;TERRAS_AGRICOLAS&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;CARBONO_FLORESTAL&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;CHUVAS&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;TEMPERATURA&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;MAO_DE_OBRA&quot;, seq(1991, 2009, 2), &quot;mean&quot;),
      list(&quot;CAPITAL_HUMANO&quot;, seq(1991, 2009, 2), &quot;mean&quot;)),
    dependent = &quot;VBP_AGRO_CO2_EQ&quot;,
    unit.variable = &quot;ID_PAIS&quot;,
    unit.names.variable = &quot;NOME_PAIS&quot;,
    time.variable = &quot;ANO&quot;,
    treatment.identifier = 19,
    controls.identifier = c(1,2, 4:10),
    time.optimize.ssr = 1991:2009,
    time.plot = 1991:2019)
  </code></pre>
  <p>Here is a useful resource about the Synth package that I used to help guide/troubleshoot:
  &quot;Synth: An R Package for Synthetic Control Methodsin Comparative Case Studies&quot;</p>
  <p>I appreciate if you can help me.</p>