title: Football Data in R - Using if statement to check for missing attribute within element?
body: <p>Straight to the situation:</p>
  <p>I am working with football tracking data, I have a list of events and within each element is recorded different situation of the game. I am interested in the passes that were made. I have for loop to iterate through the list and get me each pass for the specific team.</p>
  <pre><code>for (p in 1:length(uruguay.passes)){
    uruguay.pass.temp &lt;- all.events[[uruguay.passes[p]]]
    possession &lt;- uruguay.pass.temp$possession
    passer &lt;- uruguay.pass.temp$player$id
    .
    .
    body.part &lt;- uruguay.pass.temp$pass$body_part$name
  </code></pre>
  <p>Here comes the problem:
  Sometimes data for passer or another attribute would be missing and it messes up the whole row.
  <a href="https://i.stack.imgur.com/PtRVK.jpg" rel="nofollow noreferrer">Here is a screenshot.</a></p>
  <p>Here comes the question:
  How can I write an if statement that checks if that specific attribute i.e. Passer is present within the element and if is not present to populate the column with NA?</p>
  <p>Thank you everyone!</p>