title: Problem with Case_when function to recode new variable
body: <p>I am quite new to R and dont understand whats wrong with my code.<br />
  I have a dataframe <code>jungmodell</code> and  want to create a variable out of two other variables, <code>parteisympathie</code> and <code>Parteinah</code>.</p>
  <p><code>Parteinah</code> has expressions from -9, -8 and 1-35.<br />
  <code>Parteisympathie</code> has expressions from -9, -8-, -7 and 1-3.</p>
  <p>Only the people that answered the question from <code>Parteinah</code> with 2-35, where asked the question <code>parteisympathie</code>.</p>
  <p>The ones who answered with 1, -8, -9 on <code>Parteinah</code> were coded as -7 on <code>parteisympathie</code>.</p>
  <p>What I want to do is create a variable <code>Identifikationsskala</code>, which uses the cases that have  &quot;1&quot;, &quot;2&quot; and &quot;3&quot;  from <code>parteisympathie</code> and the ones that have &quot;1&quot; from <code>Parteinah</code>, so that I don't include the -8 or -9 (which are the people that answered with &quot;I dont know&quot; or refused to answer).</p>
  <p>I also want to recode the values, so that 1 from <code>parteisympathie</code> becomes 4, 2 becomes 3, 3 becomes 2 and the 1 from <code>Parteinah</code> stays 1.</p>
  <p>I tried the following code, but it doesn't work. There isn't a error message and R is running the code, but the values of <code>Identifikationsskala</code> dont change.</p>
  <pre><code>jungmodell &lt;- jungmodell %&gt;%  mutate(Identifikationsskala = Parteinah)  
  
  jungmodell %&gt;% mutate(Identifikationsskala = case_when(jungmodell$Parteinah == 1 ~ 1
                        ,(jungmodell$Parteinah &gt;= 2) &amp; (jungmodell$parteisympathie == 3) ~ 2, 
                        (jungmodell$Parteinah &gt;= 2) &amp; (jungmodell$parteisympathie == 2) ~ 3,
                        (jungmodell$Parteinah &gt;= 2) &amp; (jungmodell$parteisympathie == 1) ~ 4, TRUE ~ -9))
  </code></pre>
  <p>It would be awesome if someone could help me.<br />
  Thanks so much,<br />
  Franca</p>