|
Post by kitri on Aug 19, 2014 20:20:38 GMT
sorry i am a novice so my question is I am trying to run R script but i am not able to do so. I use darwin to run the script
#R script to read the GRM binary file ReadGRMBin=function(prefix, AllN=F, size=4){ sum_i=function(i){ return(sum(1:i)) } BinFileName=paste(prefix,".grm.bin",sep="") NFileName=paste(prefix,".grm.N.bin",sep="") IDFileName=paste(prefix,".grm.id",sep="") id = read.table(IDFileName) n=dim(id)[1] BinFile=file(meta, "rb"); grm=readBin(BinFile, n=n*(n+1)/2, what=numeric(0), size=size) NFile=file(meta, "rb"); if(AllN==T){ N=readBin(NFile, n=n*(n+1)/2, what=numeric(0), size=size) } else N=readBin(NFile, n=1, what=numeric(0), size=size) i=sapply(1:n, sum_i) return(list(diag=grm, off=grm[-i], id=id, N=N)) }
why can't it find the file?
|
|
|
Post by Zhihong Zhu on Sept 2, 2014 13:10:00 GMT
I think you can try directory + prefix of the grm file as the "prefix" in the function, eg. "/Users/zzhu/Documents/mygrm"
|
|