I was wondering how I could make the letter "sigma" appear in Greek with the subscript "m" in the text() part of the R code below?:
curve(dnorm(x,175.3,.961),160,190,type="l")
sigmam <- dnorm(177.4,175.3,.961)/ dnorm(177.4,176,4)
text(165,.285,paste("sigmam", "=", round(1/sigmam,digits=2)))
Subscripts and Superscripts To indicate a subscript, use the underscore _ character. To indicate a superscript, use a single caret character ^ . Note: this can be confusing, because the R Markdown language delimits superscripts with two carets.
To make a Greek letter in R, You just use \ and then the name of the letter. If you want a subscript, like β1 , you use $\beta_1$ .
You may want to include math like greek symbols, etc., in your R Markdown documents. In this class, this is totally optional. If you want a μ in your document, you can just type “mu” instead and forget about the extra complication.
Check out ?plotmath
for relevant examples of how to piece this sort of thing together. For instance, here's one adapted from the "## How to combine "math" and numeric variables :"
curve(dnorm(x,175.3,.961),160,190,type="l")
sigmam <- dnorm(177.4,175.3,.961)/ dnorm(177.4,176,4)
text(165,.285, bquote(Sigma[m] == .(round(sigmam,2))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With