title: R - Apply Family (sapply vs. vapply)
body: <p>Recently our lecturer taught us about the apply family in R.
  As I was reviewing my notes I was puzzled on one part regarding the application of sapply versus vapply as the lecturer indicated they are essentially the same.</p>
  
  <p>My understanding of sapply is that it attempts to simplify the argument it is provided and return this to the user. However, it doesn't always return a simplified value due to the input vector being of a variable length (I didn't fully understand this point). However, sapply won't point this out.</p>
  
  <p>With vapply however, you don't run the risk of having a vector fail to be simplified without you knowing as it will throw an error message if this is the case and you have to specify a return type value.</p>
  
  <p>In that case, my understanding would be that vapply would be the preferred option over sapply as it is the safer option. I asked my tutor if this was the case and he said it all came down to personal preference.</p>
  
  <p><strong>Is this truly the case - that vapply and sapply are inherently the same function except one is more fail-safe than the other? Or are there certain situation(s) where you would want to explicitly use vapply over sapply and vice versa?</strong></p>
  
  <p>I have read the following SO which has helped shed some light on the differences from a performance perspective:
  <a href="https://stackoverflow.com/questions/12339650/why-is-vapply-safer-than-sapply">Why is `vapply` safer than `sapply`?</a></p>
  
  <p>Edit: I have re-read the why-is-vapply-safer-than-sapply link but I don't think I'm fully across this. My question still stands in that, Is there a situation where sapply would be <strong>more suitable</strong> than vapply? Does such a situation exist?</p>
  
  <p>Thank you. </p>