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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:13:11+00:00 2026-05-16T09:13:11+00:00

I have several questions to do with handling some data in R: I am

  • 0

I have several questions to do with handling some data in R:

  1. I am using this statement: detailsTable <- read.table(file=commandArgs()[6], header=TRUE, col.names=c(“a”, “b”, “c”, “d”, “e”)) and it seems that the table is not being loaded correctly… but if I specify the path of the file I am loading excplicitly then all goes well. What am I doing wrong?

  2. I plot the data contained in that table mentioned above. How do I save the plot (eg: plot.savePDF(“plot.pdf”)) to a PDF file?

  3. How could I redirect the output of, for example, cor(detailsTable$a, detailsTable$b) to a file? and how do I write a simple string to a file. eg: “Correlation of the data: ” + cor(…)

  4. How do I plot the line of best fit on an existing plot?

All of this is in R.

Many thanks to anyone who can help,

ExtremeCoder

  • 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-05-16T09:13:12+00:00Added an answer on May 16, 2026 at 9:13 am

    I plot the data contained in that table mentioned above. How do I save the plot (eg: plot.savePDF(“plot.pdf”)) to a PDF file?

     pdf("filename.pdf")
     plot(...)
     dev.off()
    

    How could I redirect the output of, for example, cor(detailsTable$a, detailsTable$b) to a file? and how do I write a simple string to a file. eg: “Correlation of the data: ” + cor(…)

    check the write.table manual page (?write.table)

    How do I plot the line of best fit on an existing plot?

    x <- 1:10
    y <- 2 * x + runif(10) 
    plot (x, y, pch=20)
    fit <- glm(y~x)
    coefs <- coef(fit)
    abline(coefs, lwd=2, col='red')
    # Or also, without finding the coefficients
    abline(fit, lwd=2, col='red')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There have been several questions on SO regarding getting Contacts numbers using the Contacts
I have several questions about the PE subsystem field, which may overlap to some
I have several questions: 1. What's the difference between isoMDS and cmdscale? 2. May
I have several questions regarding filenames and the iPod Library. I understand I can
I have several questions concerning the controls like a button, if You could answer
I have several questions about properties displayed in propertyGrid i cant seem to find
I have several questions I need help with. I'll add both my code and
I thought about migrating subversion a lot and I have several questions still open.
I have a program shown as follows. For it I have several questions: 1).
Need to use own imaged markers instead built-in pins. I have several questions. 1.

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.