[R] variable of mathematics string not interpreted

From: delpacho <francois.laurent_at_mail.mcgill.ca>
Date: Thu, 08 May 2008 16:09:34 -0700 (PDT)

Hi everybody,

my goal is to display symbols on the x-axis of a barplot. I read some mathematics strings in a file and convert them to an expression as follows:

tt<- scan(file = fstr ,'what' ='character', sep = "");

for (iaa in 1:length(tt)) {
tt[iaa]<-do.call(expression, lapply(tt[iaa], as.name)); }

I obtained the following result:

tt =

expression(`alpha[tr]`, beta, widthD, `S[ts]^-5("[165,275]Hz")`,

`S[ts]^2("[165,275]Hz")`, `S[ts]^-5("[275,460]Hz")`,
`S[r]^2("[165,275]Hz")`,

`S[r]^-5("[275,460]Hz")`, `S[r]^3("[100,165]Hz")`,
`T[ts]^4("[165,275]Hz")`,

`T[ts]^7("[21,30]Hz")`, `T[ts]^8("[13,21]Hz")`, `T[r]^7("[21,30]Hz")`,
`T[r]^8("[13,21]Hz")`, `T[r]^9("[8,13]Hz")`, `E("[100,165]Hz")`,
`E("[165,275]Hz")`, `E("[60,100]Hz")`, `E("[8,13]Hz")`,
`E("[30,60]Hz")`,

`E("[21,30]Hz")`)

only the strings without "`" are interpreted properly when I put the property names.arg =tt in barplot (ex:beta displays the greek letter, whereas `alpha[tr]` displays alpha[tr]), could you explain me why these symbol "`" intervenes when I convert the strings to an expression and/or how can I have the symbols associated with the strings displayed properly?

Thanks you very much.

-- 
View this message in context: http://www.nabble.com/variable-of-mathematics-string-not-interpreted-tp17138472p17138472.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 08 May 2008 - 23:26:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 09 May 2008 - 00:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive