I have to translate a project from c# to R. In this c# project i have to handle binary files.I have three problems:
1.I am having some issues to convert this code:
//c# //this work fineusing (BinaryReader rb = new BinaryReader(archive.Entries[0].Open())){ a = rb.ReadInt32(); b = rb.ReadInt32(); c = rb.ReadDouble();}#R#this work, but it reads different values#I tried to change the size in ReadBin, but it's the same story. The working diretory is the right oneto.read <- "myBinaryFile.tmp"line1<-c(readBin(to.read,"integer",2), readBin(to.read,"double",1))
- How can I read float (in c# i have
rb.ReadSingle()
) in R? - Is there in R a function to memorize the position that you have arrived when you are reading a binary file? So next time you will read it again, you could skip what you have already read (as in c# with
BinaryReader
)