< R (programming language) < Tutorials

This tutorial demonstrates how to load data in R.

Note

  • This stub content was copied from an import of b:R Programming/Tutorial originally to How to use R/Tutorials/Introduction.

Direct loading

  • Given the data file data.txt located at <path>:
1970    45    63
1980    52    59
1990    59    52
2000    63    45
  • This data can easily be loaded into R using the following commands:
setwd("<path>")                # change working directory
data <- read.table("data.txt")  # load data

Loading csv

Stub
This section is a stub. You can help Wikiversity by expanding it.



This article is issued from Wikiversity. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.