Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8036827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:44:54+00:00 2026-06-05T02:44:54+00:00

When I try to answer a question in Stack Overflow about R, a good

  • 0

When I try to answer a question in Stack Overflow about R, a good part of my time is spent trying to rebuild the data given as example (unless the question author has been nice enough to provide them as R code).

So my question is, if somebody just asks a question and gives his sample data frame the following way :

a  b   c
1 11 foo
2 12 bar
3 13 baz
4 14 bar
5 15 foo

Do you have a tip or a function to import this easily into an R session, without having to type the entire data.frame() instruction ?

Thanks in advance for any hint !

PS : sorry if the term “query” is not really nice in my question title, but it seems you can’t use the word “question” in a question title in Stack overflow 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:44:55+00:00Added an answer on June 5, 2026 at 2:44 am

    Maybe textConnection() is what you want here:

    R> zz <- read.table(textConnection("a  b   c
    1 11 foo
    2 12 bar
    3 13 baz
    4 14 bar
    5 15 foo"), header=TRUE)
    R> zz
      a  b   c
    1 1 11 foo
    2 2 12 bar
    3 3 13 baz
    4 4 14 bar
    5 5 15 foo
    R> 
    

    It allows you to treat the text as a “connection” from which to read. You can also just copy and paste, but access from the clipboard is more dependent on the operating system and hence less portable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here, on Stack Overflow, if you try to comment a question/answer within 5 seconds
How does scala.collection.JavaConversions supercede the answers given in Stack Overflow question Iterating over Java
I read an answer to a question on Stack Overflow that contained the following
I could not find a clear answer to this question elsewhere, so I'll try
I’m honouring stack overflow with my first ever on line web building question... My
I've just found out about Stack Overflow and I'm just checking if there are
this is my first question on stack overflow, I hope you can help me.
Try running this in a .VBS file MsgBox(545.14-544.94) You get a neat little answer
Hi I didn't get an answer before so second try... I want to control
NOTE: I added my new solution at the UPDATE answer below. I try to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.