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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:49:24+00:00 2026-05-25T22:49:24+00:00

UPDATE: I actually found the solution myself, see below. In R I want to

  • 0

UPDATE: I actually found the solution myself, see below.

In R I want to add a label to a plot containing both subscript and normal text. To be more precise, I would like to use mtext() (or any other method that does the trick) to add a text below a plot. The text should look like this:

The label

This can easily done in latex with $B\pm t_{a/2}SE(B)$

In R I come as far as mtext(expression(B%+-%t[a/2])), which does print

r so far

But the difficulty is in geting the SE(B) part after it, because of expression treating SE(B) as a function. I’ve tried several combinations with paste, but to no avail. I’m sure there must be a simple solution to this, but I wasn’t able to find one after quite a long search.


UPDATE:

Wow, found the solution myself. As I said I have tried combinations of expression and paste and was sure I tried this before, but apparently, I did not. The solution is this:

mtext(expression(paste(B%+-%t[a/2],"SE(B)")))
  • 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-25T22:49:25+00:00Added an answer on May 25, 2026 at 10:49 pm

    I see you have solved this, but your final solution is much more nicely and succinctly handled by dropping the use of paste() and using the ~ operator to add spacing:

    expression(B %+-% t[a/2] ~ SE(B))
    

    e.g.:

    plot(1:10, xlab = expression(B %+-% t[a/2] ~ SE(B)))
    

    which gives

    enter image description here

    You can add extra spacing by using multiple ~: ~~~ for example. If you just want to juxtapose two parts of an equation, using the * operator, as in:

    plot(1:10, xlab = expression(B %+-% t[a/2] * SE(B)))
    

    which gives:

    enter image description here

    It isn’t immediately clear from your Q which one is preferable.

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

Sidebar

Related Questions

Big Update : As I finally found the real solution, I also discovered the
[Update] I actually compromised on this problem for now by foregoing the fixed footer
How do I turn off a monitor using VB.NET code? OK, actually I found
UPDATED POST So, I found a solution to what I was doing it is
Update In the wiki spirit of StackOverflow, here's an update: I spiked Joe White's
[Update]: my initial example doesn't reflect my problem. Updated the sample, hopfully it is
(update) ICustomTypeDescriptor works for my Windows Forms app, but not for Silverlight; Not supported.
Update: This does work, I was being stupid :( i have the following extension
****Update:** using the Rank() over partition syntax available in MS SQL Server 2005 does
UPDATE!!! Suggested answer is NOT correct, my mistake. The #container DIV should've had float:left;.

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.