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 8932693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:22:13+00:00 2026-06-15T09:22:13+00:00

I’d like to ask a beginner’s question, please, because I cannot find an answer

  • 0

I’d like to ask a beginner’s question, please, because I cannot find an answer to it anywhere. So please bear with me!
I have three complex data structures (“JAMES”, “CHARLES”, and “RICHARD”) and calculated certain values from it. Now I’d like to illustrate some of these values. Trying to use them directly gives me error messages I don’t understand. That’s why and due to the structure of the data sets I’d rather copy the values I’m interested in to a new simple data set. But I don’t know how to do this, unfortunately. I’m not even sure how to provide you with a correct machine readable example because it’s so complex. So instead of that I’d like to know the following, please:

What’s the fastest and easiest way to feed these values into R in order to illustrate them as a table or graphs in a diagram?

This is an example of the values I mentioned:

Year – “JAMES” – “CHARLES” – “RICHARD”

2001 14 10 5  
2002 15 14 7  
2003 16 16 9  
2004 17 18 11  
2005 18 20 13  

How can I create a machine readable version of the example above?

Thank you very much in advance for your consideration!

  • 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-15T09:22:14+00:00Added an answer on June 15, 2026 at 9:22 am

    The most convenient method would be to construct a dataframe using read.table()

     datfrm <- read.table(text=" Year JAMES CHARLES RICHARD
         2001 14 10 5  
         2002 15 14 7  
         2003 16 16 9  
         2004 17 18 11  
         2005 18 20 13", header=TRUE)
     datfrm
    #---console output----
      Year JAMES CHARLES RICHARD
    1 2001    14      10       5
    2 2002    15      14       7
    3 2003    16      16       9
    4 2004    17      18      11
    5 2005    18      20      13
    

    Instead of a text argument, you could have read from a file on your computer. This is rather basic stuff and suggests that you should be working through the examples in “Introduction to R” or maybe the “R for Dummies” text which has a convenient price. The second instance would be giving two of our regular SO contributors a vote of confidence. It’s very good (despite the series title which I find off-putting.)

    If these were in separate files and very long , you could read the header text with different separator, and the data with whitespace separation with both using read.table

    headerLine <- read.table(file="hdrfil.txt", sep="-")
    dfrm <- read.table(file="dat.fil", header=FALSE)
    # ...and then do:
    
    names(dfrm) <- headerLine[1,]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I have two tables with like below codes: Table: Accounts id | username |
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I've got a string that has curly quotes in it. I'd like to replace

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.