Dear all,

Please, I have a doubt regarding symbol plotting 
with data originating from a table.

Please, see below:

I have a tab delimited file called table1.txt with 4 columns:

ypos    animal  var1    var2
5       cat     gina <=  lady   gina \u2264  lady
7       dog     bill >= tony    bill \u2265 tony
9       fish    dude <= bro     dude \u2264 bro


#I then load in the data to R:
table1<-read.table("table1.txt", header=TRUE, sep="\t")

#if I take a look at the table I realize that \u2264 was replaced by \\u2264
table1

#So, if i try to plot the data
#instead of greater/equal or lesser/equal I get
#a text string plotted "\u2265"
plot(1:1,col="white",xlim=c(1,10),ylim=c(1,10),ylab="",axes=FALSE,xlab="")
text(y=table1$ypos,x=2,table1$animal)
text(y=table1$ypos,x=4,table1$var1) 
text(y=table1$ypos,x=8,table1$var2) 

#this can be fixed if I manually erase the extra "\" on var2
fix(table1)
plot(1:1,col="white",xlim=c(1,10),ylim=c(1,10),ylab="",axes=FALSE,xlab="")
text(y=table1$ypos,x=2,table1$animal)
text(y=table1$ypos,x=4,table1$var1) 
text(y=table1$ypos,x=8,table1$var2)

#However if I save the graph to a ps file, it shows the "<=" sign as "..."
postscript("teste3.ps", width = 22, height = 
11.5,pointsize=24,paper="special",bg="transparent")
plot(1:1,col="white",xlim=c(1,10),ylim=c(1,10),ylab="",axes=FALSE,xlab="")
text(y=table1$ypos,x=2,table1$animal)
text(y=table1$ypos,x=4,table1$var1) 
text(y=table1$ypos,x=8,table1$var2)
dev.off()


#My solution was to plot "<" or ">" instead of "<=" and ">="
# and then plot an hifen under the "<" or the ">" sign.
# This worked to fix both problems, but is hard to do and
# impossible to automate (or at least very difficult)

#Please, does anyone know a better approach?
#thanks in advance

Victor Faria Seabra, MD
vsea...@uol.com.br

______________________________________________
R-help@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.

Reply via email to