scanText {CGIwithR} | R Documentation |
Useful for converting data entered via a HTML textarea, for example, into a list or vector for further processing.
scanText(string, what = character(0), ...)
string |
A character string, typically numbers or words separated by white space |
what |
As for scan . The type of what gives the
type of data to be read. If
what is a list, it is assumed that the lines of the data
file are records each containing length(what) items
(``fields''). The supported types are logical , integer ,
numeric , complex , character and
list : list values
should have elements which are one of the first five types
listed or NULL . |
... |
Other arguments to be passed to scan |
A list or vector.
David Firth d.firth@warwick.ac.uk
scanText("A few short words") as.numeric(scanText("1 2 3\n89 90")) scanText("A B C \n 4 5 6", what = list("A", "A", "A", 0, 0, 0))