Skip to content

Instantly share code, notes, and snippets.

@meaganewaller
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meaganewaller/6ee9c2f59211216f4909 to your computer and use it in GitHub Desktop.
Save meaganewaller/6ee9c2f59211216f4909 to your computer and use it in GitHub Desktop.
Reading Data in R
myConnection <- file("foo.txt", "r")
data <- read.csv(myConnection)
close(myConnection)
# the same thing as
data <- read.csv("foo.txt")
initial <- read.table("dataset.txt", nrows = 100)
classes <- sapply(initial, class)
tabAll <- read.table("dataset.txt", colClass = classes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment