Example #1
0
def get_response_content(fs):
    # get the r table
    rtable = RUtil.RTable(fs.table.splitlines())
    header_row = rtable.headers
    data_rows = rtable.data
    Carbone.validate_headers(header_row)
    # check requested variable names as column headers
    if fs.var_a not in header_row:
        raise ValueError('the first variable name is not column header')
    if fs.var_b not in header_row:
        raise ValueError('the second variable name is not column header')
    return RUtil.run_with_table(fs.table, fs, get_script_content)
Example #2
0
def get_response_content(fs):
    # get the r table
    rtable = RUtil.RTable(fs.table.splitlines())
    header_row = rtable.headers
    data_rows = rtable.data
    Carbone.validate_headers(header_row)
    # check requested variable names as column headers
    if fs.var_a not in header_row:
        raise ValueError('the first variable name is not column header')
    if fs.var_b not in header_row:
        raise ValueError('the second variable name is not column header')
    return RUtil.run_with_table(fs.table, fs, get_script_content)
Example #3
0
def get_response_content(fs):
    # get the r table
    rtable = RUtil.RTable(fs.table.splitlines())
    header_row = rtable.headers
    data_rows = rtable.data
    Carbone.validate_headers(header_row)
    # check requested variable names as column headers
    if fs.variable not in header_row:
        msg = 'the variable name was not found as a column in the data table'
        raise ValueError(msg)
    if fs.factor not in header_row:
        msg = 'the factor name was not found as a column in the data table'
        raise ValueError(msg)
    return RUtil.run_with_table(fs.table, fs, get_script_content)
Example #4
0
def get_response_content(fs):
    # get the independent variable names
    indep = Util.get_stripped_lines(fs.independent.splitlines())
    dep = fs.dependent
    # get the r table
    rtable = RUtil.RTable(fs.table.splitlines())
    header_row = rtable.headers
    data_rows = rtable.data
    Carbone.validate_headers(header_row)
    # check requested variable names as column headers
    bad_indep_names = set(indep) - set(header_row)
    if bad_indep_names:
        raise ValueError('these requested independent variable names '
                         'were not found as columns '
                         'in the data table: ' + str(bad_indep_names))
    if dep not in header_row:
        raise ValueError('the dependent variable name '
                         'was not found as a column in the data table')
    return RUtil.run_with_table(fs.table, (indep, dep), get_script_content)
Example #5
0
def get_response_content(fs):
    # get the independent variable names
    indep = Util.get_stripped_lines(fs.independent.splitlines())
    dep = fs.dependent
    # get the r table
    rtable = RUtil.RTable(fs.table.splitlines())
    header_row = rtable.headers
    data_rows = rtable.data
    Carbone.validate_headers(header_row)
    # check requested variable names as column headers
    bad_indep_names = set(indep) - set(header_row)
    if bad_indep_names:
        raise ValueError(
            "these requested independent variable names "
            "were not found as columns "
            "in the data table: " + str(bad_indep_names)
        )
    if dep not in header_row:
        raise ValueError("the dependent variable name " "was not found as a column in the data table")
    return RUtil.run_with_table(fs.table, (indep, dep), get_script_content)