Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206657

how can I translate c# binary files reading into R?

$
0
0

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)) 
  1. How can I read float (in c# i have rb.ReadSingle()) in R?
  2. 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)

Viewing all articles
Browse latest Browse all 206657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>