vendredi 29 mars 2019

How to make a function containing all true values of another function

I have a function(x) that includes an if statement in r where the output of the inserted value is either TRUE or FALSE. I now want to make another function(y) which will display (y) number of true values. For example if I was testing in the first function whether a number is divisible by three, which would be true. Then in the next function, if I input 3, I want to program the function so it displays the first three true numbers, so in this case 3, 6, 9.

Aucun commentaire:

Enregistrer un commentaire