【发布时间】:2019-05-30 16:52:26
【问题描述】:
我想使用表达式或 bquote 在情节的主要部分使用“小于或等于” (≤) 符号。
很遗憾,我的代码出错了。
错误:"bq.FWGroup 中出现意外的 '
你能帮我解决这个问题吗?
FWGroup<-c("20cm <= Length < 30cm, 175g <= Weigth < 225g","20cm <= Length < 30cm, 225g <= Weigth < 275g", "30cm <= Length < 40cm, 200g <= Weigth < 250g","30cm <= Length < 50cm, 250g <= Weigth <= 300g") Köder<-c("lebend","Atrappe") Versuche<-c(7,3,6,8,6,12,5) Versuche<-cbind(Versuche,c(3,8,2,1,7,4,9)) Group<-c(1,1,2,1,4,2,3) #for (i in 1:4) { # for (j in 1:2) { i<-1; j<-1 plot(1:7,Versuche[,1], type="n", main=paste(FWGroup[i],"Koeder:",Koeder[j],"_______________")) #bquote: bq.FWGroup<-c(bquote("20cm "~ <= ~" Length < 30cm, 175g" ~ <= ~ "Weigth < 225g"),bquote("20cm <= Length < 30cm, 225g <= Weigth < 275g"),bquote("30cm <= Length < 40cm, 200g <= Weigth < 250g"),bquote("30cm <= Length < 50cm, 250g <= Weigth <= 300g")) plot(1:7,Versuche[,1], type="n", main=paste(bq.FWGroup[i],"Koeder:",Koeder[j],"_______________")) #exqpression: ex.FWGroup<-c(paste("20cm ", expression(<=), " Length < 30cm, 175g", expression(<=) , "Weigth < 225g"),"20cm <= Length < 30cm, 225g <= Weigth < 275g","30cm <= Length < 40cm, 200g <= Weigt < 250g","30cm <= Length < 50cm, 250g <= Weigth <= 300g") ex.FWGroup<-c( expression(paste("20cm ", <=, " Length < 30cm, 175g", <= , "Weigth < 225g")),"20cm <= Length < 30cm, 225g <= Weigth < 275g", "30cm <= Length < 40cm, 200g <= Weigth < 250g","30cm <= Length < 50cm, 250g <= Weigth <= 300g") plot(1:7,Versuche[,1], type="n", main=paste(ex.FWGroup[i],"Koeder:",Koeder[j],"_______________")) # } # }
【问题讨论】:
标签: r plot expression