def estimate_cp_pval(ts, method="<STR_LIT>"):
"""<STR_LIT>"""<EOL>robjects.r("<STR_LIT>")<EOL>method_map = {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>}<EOL>mt = robjects.FloatVector(ts)<EOL>robjects.globalenv["<STR_LIT>"] = mt<EOL>cmd = method_map[method].format("<STR_LIT>")<EOL>robjects.globalenv["<STR_LIT>"] = robjects.r(cmd)<EOL>ecp_pval = robjects.r("<STR_LIT>")<EOL>ecp = ecp_pval[<NUM_LIT:0>]<EOL>pval = ecp_pval[<NUM_LIT:1>]<EOL>return ecp, pval<EOL>
Estimate changepoints in a time series by using R.