[R] About scan

Stephen Liu satimis at yahoo.com
Wed Aug 18 05:42:11 CEST 2010


Hi folks,


I followed an online example to input data;

> x = scan(1,2,3,4,5)
Error in scan(1, 2, 3, 4, 5) : 
  either specify 'nmax' or 'n', but not both.

It can't work.


> x = c(1,2,3,4,5)
> x
[1] 1 2 3 4 5

It works.


Whether "scan" is replaced with "c" ?

> ?c
.....
Usage:
     c(..., recursive=FALSE)


TIA


B.R.
Stephen L





More information about the R-help mailing list