Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Vector Data

To interactively create a vector of data use the scan function which can, for example, read data you type until it finds an empty line:

> ds <- scan()
1: 20 35 15 55
5: 40 27 37 47
9:
Read 8 items
> ds
[1] 20 35 15 55 40 27 37 47

Alternatively, you may have a simple list of numbers in one of your windows and simply wish to load this into a vector. For example, select the list of numbers below (e.g., hold down the left mouse button while you highlight the list of numbers).

54 56 57 59 63 64 66 68 68 72 72 75 76 81 84 88 106

In the R window specify the filename to be clipboard and the selected numbers will be read. For example:

> ds <- scan("clipboard")
Read 17 items
> ds
 [1]  54  56  57  59  63  64  66  68  68  72  72  75  76  81  84  88 106



Copyright © 2004-2006 [email protected]
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware.