DATA MINING
Desktop Survival Guide by Graham Williams |
|||||
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 |
> 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 |