[R] Binary Value into Text

Jim Lemon drjimlemon at gmail.com
Tue Jun 14 02:56:29 CEST 2016


Hi Fahman,
That error message usually means that there is no newline at the end
of the last line of the input file. Try adding a newline,

Jim


On Tue, Jun 14, 2016 at 1:17 AM, Fahman Khan via R-help
<r-help at r-project.org> wrote:
> I have written a following piece of code.
>> binaryFile <- file("sampleBinary.dat", 'rb')>readBin(binaryFile, character(), endian="little")
>
> I'm getting a warning message that says
>
> Warning message: In readBin(binaryFile, chracter(), endian="little") : incomplete string at end of file has been discarded
>
> I did research on this topic but was still unable to solve.
>
> My file contains the following binary values: 01101000 01100101 01101100 01101100 01101111 00001010 which is hello in text. I just want to convert this into text.
>
> Any help would be appreciated.
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list