(R-intro.info)Reading data from files


Next: Probability distributions Prev: Lists and data frames Up: Top
Enter node , (file) or (file)node

7 Reading data from files
*************************

Large data objects will usually be read as values from external files
rather than entered during an R session at the keyboard.  R input
facilities are simple and their requirements are fairly strict and even
rather inflexible.  There is a clear presumption by the designers of R
that you will be able to modify your input files using other tools, such
as file editors or Perl(1) to fit in with the requirements of R.
Generally this is very simple.

   If variables are to be held mainly in data frames, as we strongly
suggest they should be, an entire data frame can be read directly with
the 'read.table()' function.  There is also a more primitive input
function, 'scan()', that can be called directly.

   For more details on importing data into R and also exporting data,
see the _R Data Import/Export_ manual.

The read.table() function
The scan() function
Accessing builtin datasets
Editing data
   ---------- Footnotes ----------

   (1) Under UNIX, the utilities 'sed' or'awk' can be used.


automatically generated by info2www version 1.2.2.9