R Grep Function - working with the outcome matches to fill a column
<p>I am trying to come with a solution for using grep function to a column of data and filling the grep matches with a number 1 and fill the mismatches with O´s but I just can´t come up with a solution (I am totally new to R, so what I am doing is probably going to make some folks lol).</p>

<pre><code>info &lt;- cbind(info, A_DO = ifelse(grep("DO",info[,"ACTUAL"])&gt;0,1,0)
</code></pre>

<p>The info table looks like this:(I´ve included the last column as that is my desired ouput)</p>

<pre><code>PLAZA_CR|TZ|LOCATION|FA|TIPO_REPARTO|ACTUAL|NUEVO|**A_DO**
10GTO|8|19973|3633|DIURNO|DO|MI|**1**
10GTO|8|19975|10198|DIURNO|LUJU|DO|**0**
10GTO|8|1237|3633|DIURNO|DO|LUJU|**1**
10GTO|8|20204|3633|DIURNO|DOMAJU|LUMIJU|**1**
10GTO|8|1108|3633|DIURNO|LUMIJU|DOMAJU|**0**
10GTO|8|10895|368|DIURNO|DO|DOMIVI|**1**
10GTO|8|9434|3634|DIURNO|DOMIVI|DO|**1**
10GTO|8|17403|3633|DIURNO|DOLUMAMIJUVI|MAVI|**1**
10GTO|8|17404|3633|DIURNO|MAVI|DOLUMAMIJUVI|**0**
10GTO|8|2585|368|DIURNO|LUJU|DOMIVI|**0**
10GTO|8|16927|3634|DIURNO|DOMIVI|LUJU|**1**
</code></pre>