2017-10-13 6 views
0

下付き文字のラベルがn個あります。定義されているラベル:プロットラベルの変数としての添え字

lab<-c("NO[2]","NO","CO[2]","CO") 
lab2<-noquote(lab) 
plot(1,1,xlab=bquote(.(lab[1]))) 
plot(1,1,xlab=bquote(.(lab2[1]))) 

私はこれをしたいが、.variable

plot(1,1,xlab=bquote(NO[2])) 

との任意のアイデア?

答えて

0

あなたはparse文字列にする必要があります。

plot(1, 1, xlab = bquote(.(parse(text = lab[1])))) 

enter image description here