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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:58:25+00:00 2026-06-13T13:58:25+00:00

I know stuff has been posted, but not as complete as what I am

  • 0

I know stuff has been posted, but not as complete as what I am looking for.

Take any help function (i.e. ?mean), and realise that it’s output (or at least output should be able to be generated in the same manner).

How do you get enters, alignment/intendation?

Example:

strings <- c("t", "df", "p-value", "mean of x", "mean of y")
values  <- c(t, df, pvalue, mean1, mean2)

If this would be the things you’d want to output in R (when called from a function), how do you make the [1] disappear, and the values lined up?

  • 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-13T13:58:26+00:00Added an answer on June 13, 2026 at 1:58 pm

    This is rather elementary, please consult An Introduction to R as well as

    • help(cat)
    • help(sprintf)
    • help(format)

    and many more. See the (literally thousands) of examples in formatting functions. Here is a simple example from one of my packages:

    print.summary.fastLm <- function(x, ...) {
        cat("\nCall:\n")
        print(x$call)
        cat("\nResiduals:\n")
        print(x$residSum)
        cat("\n")
    
        printCoefmat(x$coefficients, P.values=TRUE, has.Pvalue=TRUE)
        digits <- max(3, getOption("digits") - 3)
        cat("\nResidual standard error: ", formatC(x$sigma, digits=digits), " on ",
            formatC(x$df), " degrees of freedom\n", sep="")
        cat("Multiple R-squared: ", formatC(x$r.squared, digits=digits),
            ",\tAdjusted R-squared: ",formatC(x$adj.r.squared, digits=digits),
            "\n", sep="")
        invisible(x)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know the tagging stuff has been mentioned many times, but I can't seem
I know this stuff has been talked about a lot, but I'm having a
I know this has been asked before and Ive tried lots of stuff but
Alright, so I know about the Settings.Properties.Default.* Stuff, but thats not what im trying
I know this sort of question has been asked before , but I still
I know there has been a lot of posts on this but it still
Ok guys I know this question has been asked before but I am very
So, I know this has been done to death but all the answers I've
I know this question has been asked many times before but I tried out
I know this kind of question has been asked before, but the general solution

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.