Raisinmeister
2010-Feb-11 12:01 UTC
[R] Coda or R or input error? (Error in lowess(xp, yp[, k]) :...)
I have been using R with the packages locfit and coda to analyse output from a population genetics program (msvar) which I have been running on an external server (http://cbsuapps.tc.cornell.edu/ index.aspx). One of the first steps is to read the msvar output tables into R and then use coda to analyse the MCMC object. Sometimes, this works perfectly and sometimes, when I try to plot the output, it does not! The error message I get is- "Error in lowess(xp, yp[, k]) : NA/NaN/Inf in foreign function call (arg 2)" Someone mentioned that this may be because R is very memory hungry and it may be too much for my laptop to cope with. So I tried running it on another computer and this time I cannot even get as far as creating the MCMC object, I get a message telling me that there are non-numeric values: "Error in mcmc(data = D1) : Data frame contains non- numeric values" I find it difficult to believe that there are any non-numeric values as I have run the msvar analysis on 5 different projects and treated the outputs in exactly the same way; 2 have worked perfectly but the other 3 all produce these same messages. I have checked for empty lines at the end of the files. Is it likely to be because the files are too large? Any help or suggestions would be gratefully received. Many thanks I have pasted the R transcripts below, just in case anyone fancies a read! Laptop- Lowess error> A1<-read.table(file="hparsA1.dat",sep=" ") > A2<-read.table(file="hparsA2.dat",sep=" ") > A3<-read.table(file="hparsA3.dat",sep=" ") > dim(A1)[1] 200000 11> dim(A2)[1] 200000 11> dim(A3)[1] 200000 11> mcmc.A1<-mcmc(data=A1) > mcmc.A2<-mcmc(data=A2) > mcmc.A3<-mcmc(data=A3) > plot(mcmc.A1)Error in lowess(xp, yp[, k]) : NA/NaN/Inf in foreign function call (arg 2)> plot(mcmc.A2)Error in lowess(xp, yp[, k]) : NA/NaN/Inf in foreign function call (arg 2)> plot(mcmc.A3)Error in lowess(xp, yp[, k]) : NA/NaN/Inf in foreign function call (arg 2) Desktop- Non-numeric error> D1<-read.table(file="hparsD1.dat",sep=" ") > D2<-read.table(file="hparsD2.dat",sep=" ") > D3<-read.table(file="hparsD3.dat",sep=" ") > mcmc.D1<-mcmc(data=D1)Error in mcmc(data = D1) : Data frame contains non-numeric values> mcmc.D2<-mcmc(data=D2)Error in mcmc(data = D2) : Data frame contains non-numeric values> mcmc.D3<-mcmc(data=D3)Error in mcmc(data = D3) : Data frame contains non-numeric values