3

Is there any way to include Greek letters (α,β,γ) into column names of a matrix? I know you use:

colnames()<-c("column 1","column 2","column 3".....)

to add column names but when i tried to paste in the letters...

colnames(mymatrix)<-c("random name","parameters(α,β,γ)","parameters2(α,β,γ)")

it shows the "(α,β,γ)" as "(??,??,??)"

How can this be done?

starball
  • 20,030
  • 7
  • 43
  • 238
Summer Gleek
  • 334
  • 5
  • 15
  • It works fine for me on a Mac, but I would avoid using anything other than plain text for names. – Lars Lau Raket Oct 03 '14 at 13:28
  • 1
    Yeah i just found that it actually works on r, it saves fine as a picture too but pasting that picture into word is when the symbols disappear and are replaced by the question marks....which is kinda strange :/ – Summer Gleek Oct 03 '14 at 13:34
  • What do you mean by "as a picture"? If you plot the matrix you should probably use expression(alpha) instead of "α". – Lars Lau Raket Oct 03 '14 at 13:45
  • 1
    I saved the matrix as a table and then used `png()` to save it as a picture to put it into a document easily. does `expression(alpha) work if it is within "" because i need it to be combined with "Parameters of in-sample(alpha,beta,gamma)" – Summer Gleek Oct 03 '14 at 14:05
  • 1
    In that case you should use something like `expression(paste("Parameters of in-sample(", alpha, ",", beta, + ",", gamma, ")", sep = ""))` – Lars Lau Raket Oct 03 '14 at 14:09
  • 2
    @SummerGleek You will not be able to use expressions as column names of matrices. Colnames need to be character vectors. I'm realizing that you now you really need to edit this question to add all the missing code example and workflow if you want a stable answer. – IRTFM Oct 03 '14 at 15:30

0 Answers0