Hi Friends, I have a data set like this 1 2 3 4 5 6 7 8 9 10 Is there a way to read it into R as a row or column vector? Thanks very much. Johnny Department of Psychology University of Virginia USA http://www.people.virginia.edu/~zz5m __________________________________________________ [[alternative HTML version deleted]]
On Wed, 2004-09-29 at 21:35, Johnny Zhang wrote:> Hi Friends, > I have a data set like this > 1 > 2 3 4 5 > 6 7 > 8 9 10 > Is there a way to read it into R as a row or column vector?You can use scan(). Presuming that your data above is in a file called "MyFile.txt":> MyData <- scan("MyFile.txt")Read 10 items> MyData[1] 1 2 3 4 5 6 7 8 9 10 See ?scan for more information. HTH, Marc Schwartz