How can i count y/n answer in r?
<p>I will create survey with r programming. But i am new one. I want to count "yes" and "no" answer which will ask each people. And create data with them. How can i do this? My code is as follows:</p>

<pre><code> survey &lt;- c ("Are you student?", "Do you drive car?", "Do you smoke cigarette?")

surveyfunct &lt;- function(v,m){
   for(i in 1:length(v))
       {m &lt;-readline(v[i])
        if (m == "yes" &amp;&amp; m == "no"){
            m &lt;- readline(v[i+1])}}
    return (list(m))}
</code></pre>