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

  • Home
  • SEARCH
  • 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 7812037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:22:53+00:00 2026-06-02T04:22:53+00:00

I have a data frame with numbers resembling: df$X1 df$X2 .9 1.442 How could

  • 0

I have a data frame with numbers resembling:

df$X1    df$X2

.9     1.442

How could I use elements from this data frame to create labels for a confidence intervals that will be nicely formatted string:

(0.90, 1.42)

I’m lost somewhere between paste, as.character and c() and nothing seems to work :/

  • 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-02T04:22:54+00:00Added an answer on June 2, 2026 at 4:22 am

    How about something like:

    paste("(",df$X1,",",df$X2,")",sep="")
    

    In your example, it looks like you might want to round your numbers, but the rounding is incorrect. Do you want a certain number of digits after the decimal point?

    Also, “1” and “2” are frowned upon as names in a data.frame – see ?make.names

    EDIT:

    To round in cases like this, I like using formatC():

    paste("(", formatC(df$X1, digits = 2, format = "f"), ",",
      formatC(df$X2, digits = 2, format = "f"), ")", sep = "")
    

    However, if there are values less than .005, note that they will end up being 0.00.

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

Sidebar

Related Questions

I have a data.frame from this code: my_df = data.frame(read_time = c(2010-02-15, 2010-02-15, 2010-02-16,
I have a data frame with gaps like this: Var1 Var2 Var3 1 NA
I have a data.frame in R that looks like this: score rms template aln_id
I have a data frame in R that has come about from running some
I have a data.frame that looks like this > head(df) Memory Memory Memory Memory
i have data frame like this : 1 2 3 4 5 1 0.1
I have a data frame with 30 columns numbered from 0 to 29. I
I have a large data frame (named z ) that looks like this: RPos
Say I have a data frame like this: Df <- data.frame( V1 = c(1,2,3,NA,5),
I have a data frame that looks like this: user1,product1,0 user1,product2,2 user1,product3,1 user1,product4,2 user2,product3,0

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.