Hi Everyone,
I am new R user and am trying to learn by reading the online manual "An
Introduction to R" from the R web site. I am trying to practice using the
scan() function as explained in the manual. For this I first created three
vectors (one a character vector and two numeric one) and saved file
"input.dat" in my working directory as:
> label <- c("Bill", "Tom", "Pat", "Will", "Sue", "Sam")
> x <- 1:6
> y <- 6:1
> save(label, x, y, file = "input.dat")
Now, when I try the scan() function as explained in the manual as below, I
get the error message:
> inp <- scan("input.dat", list("",0,0))
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
:
scan() expected 'a real', got 'X'
I have not been able to figure out what the problem is. I would appreciate
if someone could please guide me as to what I am doing wrong. Regards,
Tariq
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
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.