I am trying to call the ccf function used in r with python.
from rpy2.robjects.packages import SignatureTranslatedAnonymousPackage
string = """
cc <- function(x,y) {
ccf(x,y)
}
"""
powerpack = SignatureTranslatedAnonymousPackage(string, "powerpack")
Calling:
import rpy2.robjects as ro
x = [1,2,3,4,5,5]
y = [5,6,7,8,8,9]
x = ro.Vector(tuple(x))
y = ro.Vector(tuple(y))
print (powerpack.cc(x,y))
Error:
RRuntimeError: Error in x[, (1 + cs[i]):cs[i + 1]] <- xx :
incorrect number of subscripts on matrix
Any suggestions on how to correct this would be great.