def make_R_install_option(opt, values, cmdline=False):
    """
    Make option list for install.packages, to specify in R environment.
    """
    txt = ''
    if values:
        if cmdline:
            txt = ' --%s="%s' % (opt, values[0])
        else:
            txt = '%s=c("%s' % (opt, values[0])
        for i in values[1:]:
            txt += ' %s' % i
        if cmdline:
            txt += '"'
        else:
            txt += '")'
    return txt
