I'm getting the following error when I try to read a large data.frame.Error occured in the R session.
Invalid token 0x4a found at lexpos 16, length 16150796
I actually only need to execute the query that creates the data.frame in R and don't need the data itself.
Is it possible to execute a command in R using pyRServe but not to try to process the response, or even to tell R to not return a response? This is possible in RServe I think.
Thanks
Kyle
Hi Ralph,I am having a similar problem. Sometimes I get this error, other times I do not and everything works perfectly, so I suspect it has something to do with the size of the data frame. Below is the error code and a code snippet so that you can try to reproduce the problem (I have also attached the input file that throws the error). Thanks so much in advance for your help!Cheers,Katie--Kathleen Fisch, Ph.D.Postdoctoral FellowCA Sea Grant Delta Science ProgramCODE SNIPPETimport pyRserveconn = pyRserve.connect(host='localhost', port=6311)conn.r('library(kinship2)')conn.r('setwd("C:/programming")')conn.r('table <- read.table("PedigreeConcatenated.ped")')conn.r('closeAllConnections()')conn.r('table[,9][table[,4] %in% "M"] <- 1')conn.r('table[,9][table[,4] %in% "F"] <- 2')conn.r('data <- as.data.frame(table)')conn.r('udata <- data[!duplicated(data[,1]),]')conn.r('udata.sub <- subset(udata, V11 > 900)')conn.r('udata.sub[order(udata.sub[,1]),]')conn.r('pedAll <-pedigree(id=udata.sub[,1], dadid=udata.sub[,2], momid=udata.sub[,3], sex=udata.sub[,9])')conn.r('kinAll <- kinship(pedAll)')print 'Kinship matrix', conn.r.kinAll[1:14, 1:14]conn.r('write.csv(kinAll, "kinmatrix.csv")')conn.close()ERROR CODETraceback (most recent call last):File "C:\Documents and Settings\KFisch\repos\Hatchery Genetic Modeling\src\Kinship.py", line 40, in rKinshipMatrixconn.r('kinAll <- kinship(pedAll)')File "build\bdist.win32\egg\pyRserve\rconn.py", line 205, in __call__File "build\bdist.win32\egg\pyRserve\rconn.py", line 36, in decoCheckIfClosedFile "build\bdist.win32\egg\pyRserve\rconn.py", line 97, in evalFile "build\bdist.win32\egg\pyRserve\rparser.py", line 481, in rparseFile "build\bdist.win32\egg\pyRserve\rparser.py", line 302, in parseFile "build\bdist.win32\egg\pyRserve\rparser.py", line 321, in _parseFile "build\bdist.win32\egg\pyRserve\rparser.py", line 327, in _parseExprFile "build\bdist.win32\egg\pyRserve\rparser.py", line 169, in nextExprHdrpyRserve.rtypes.RParserError: Invalid token 0x61 found at lexpos 20, length 14484292