private static void addVariableIfRequired(DataSet data,String var){
  List<String> nodes=data.getVariableNames();
  if (!nodes.contains(var)) {
    data.addVariable(new ContinuousVariable(var));
  }
}

private static void addVariableIfRequired ( DataSet data , String var ) { List < String > nodes = data . getVariableNames ( ) ; if ( ! nodes . contains ( var ) ) { data . addVariable ( new ContinuousVariable ( var ) ) ; } }
adds a column for the given varible if required .
