mercredi 25 mai 2016

large number of if...else statements on large number of variables

I have an Excel file used to manually categorize clients into approx 250 different groups or subgroups (there can be up to 6 levels: 3.31.311...)

Categorization of a client (as an observation of 300 variables) in each group is achieved with combination of simple thresholds conditions (and/or) but on a potentially high variety of the numeric variables (varXX). Until now the matrix of conditions is in Excel+text form like this:

enter image description here

That leads to my question(s):

  1. Is there a limit on the number of else statements (in R) inside a if condition?

  2. Since I plan to automatize this categorization in R software, I have absolutely no idea of the best way to code it. I guess it will take hundreds of lines of code (with a huge potential for mistakes), but is there a smarter way to do it?

Aucun commentaire:

Enregistrer un commentaire