I\'m new to R and used to work with Matlab beforehand. Now I\'m trying to calculate the chance that a specific condition occurs with an if -else loop. But as I discovered an