Skip to content

Instantly share code, notes, and snippets.

@tomhopper
Created February 13, 2018 21:30
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 tomhopper/165b9c8d1a2cf1aa114baaaa0d16da22 to your computer and use it in GitHub Desktop.
Save tomhopper/165b9c8d1a2cf1aa114baaaa0d16da22 to your computer and use it in GitHub Desktop.
Copy and paste data into R
# Paste the data into a string:
data_string <- " Filename Fc
Q5161811.04 20.36
Q5161811.04 20.46
Q5161811.04 24.17
Q5161811.04 20.20 "
# Use a fileConnection to read the data into a data frame
the_data <- read.table(file = textConnection(object = data_string),
header = TRUE,
sep = "",
stringsAsFactors = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment