I have a datafile mydata that has n number of columns. If n is even I would like to use (n/2)+1 as a formula. If n is odd I would like to use (n/2)+0,5 as a formula. Then I would like to store the outcome as a number, so that I can use this number later on in the script.
How can I do this in R? I've tried some things with %%2==0, but I can't get it to work.
Aucun commentaire:
Enregistrer un commentaire