[R] File Reading Problem
jimingyu at princeton.edu
Mon Sep 1 23:26:43 CEST 2003
I am trying to read characters byte by byte(in their ASCII codes) from a
file(already transferred from text file to a file of ASCII codes, by C
language). I am using scan() function. But it seems that this is impossible.
If I read data as 'character' type, data are read word by word,
separated by spaces(though in default setting, sep=""). e.g. if a file
contains "This is a book.", Then it reads "This", "is", "a", "book.", not
"T", "h", "i", "s", etc(as I wanted it to).
If I read data as 'integer' type from the file which contains all ASCII
codes of the original file, e.g. if a file contains "This is a book.", Then
it reads "T", " ", "i", " ", "a", " " , "b", which are initials of all words
and all spaces, not "T", "h", "i", "s", etc(as I wanted it to).
If anybody has a solution, please let me know. I'd really appreciate
your help. Thank you very much!
Information Sciences and Systems Group
Department of Electrical Engineering
Email: jimingyu at princeton.edu
More information about the R-help