3. Data Input

  1. Michael J. Crawley

Published Online: 6 NOV 2012

DOI: 10.1002/9781118448908.ch3

The R Book, Second Edition

The R Book, Second Edition

How to Cite

Crawley, M. J. (2012) Data Input, in The R Book, Second Edition, John Wiley & Sons, Ltd, Chichester, UK. doi: 10.1002/9781118448908.ch3

Author Information

  1. Imperial College London at Silwood Park, UK

Publication History

  1. Published Online: 6 NOV 2012
  2. Published Print: 7 DEC 2012

ISBN Information

Print ISBN: 9780470973929

Online ISBN: 9781118448908



  • data input;
  • data input from the keyboard, from files;
  • data input directly from the web;
  • input from files using scan, reading a dataframe;
  • reading data from a file using readLines;
  • reading non-standard files, using readLines;
  • warnings, in attaching dataframe;
  • checking files from command line;
  • built-in data files;
  • reading data from external database, and DSN


This chapter contains sections titled:

  • Data input from the keyboard

  • Data input from files

  • Input from files using scan

  • Reading data from a file using readLines

  • Warnings when you attach the dataframe

  • Masking

  • Input and output formats

  • Checking files from the command line

  • Reading dates and times from files

  • Built-in data files

  • File paths

  • Connections

  • Reading data from an external database