Creates a new analysis group with unique settings for plotting/tabulating etc.
        or switches the active group to the specified name.

def do_group(self, arg):
        """Creates a new analysis group with unique settings for plotting/tabulating etc.
        or switches the active group to the specified name.
        """
        from copy import deepcopy
        vals = arg.split()
        if len(vals) == 0 or vals[0] not in ["list", "duplicate", "add", "switch", "remove"]:
            self.help_group()
            return

        if vals[0] == "add":
            if vals[1] not in self.args[self.active]:
                self.args[self.active][vals[1]] = self._template_args.copy()
                msg.okay("Created analysis group '{}'.".format(vals[1]))
                self.do_group("switch {}".format(vals[1]))
            else:
                msg.info("Group '{}' already exists. Switching to it.".format(vals[1]))
                self.do_group("switch {}".format(vals[1]))
        elif vals[0] == "switch":
            if vals[1] in self.args[self.active]:
                self.group = vals[1]
                self._set_def_prompt()
            else:
                msg.warn("The group '{}' does not exist.".format(vals[1]))
        elif vals[0] == "duplicate" and len(vals) == 3 and vals[1] in self.args[self.active]:
            self.args[self.active][vals[2]] = deepcopy(self.args[self.active][vals[1]])
            msg.okay("Duplicated analysis group '{}' into '{}'.".format(vals[1], vals[2]))
            self.do_group("switch {}".format(vals[2]))
        elif vals[0] == "list":
            for key in self.args[self.active]:
                msg.info(key)
        elif vals[0] == "remove" and vals[1] in self.args[self.active]:
            del self.args[self.active][vals[1]]
            self.do_group("list")