Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How to disable message null device when using R and latex.

<<echo=FALSE ,results=tex>>=
data<-read.table("test",sep="\t",header=TRUE,check.names=FALSE)
names(data)<-substr(names(data),1,20)
pdf("image.pdf")
par(las=2)
par(mar=c(2,12,2,2))
barplot(as.matrix(disease_data),beside=TRUE, col=c("burlywood1 ","orange2"), horiz=TRUE,cex.names=1.0, border ="white")
dev.off()
@

I have already disable echo but null device is on image. How can i avoid it?

Regards Regards

share|improve this question
add comment

1 Answer

echo=FALSE only hides the R code; if you want to hide the output, you should use results=hide.

But why do you have to use pdf() and dev.off() to manually create a PDF plot? This is too awkward. You should leave this job to Sweave.

share|improve this answer
    
Now i am using sweave but i can not reduce image size that is why i am using includegraphics by passing width and height to control its size. Is there any way to reduce plot size in R? –  manish Apr 25 '12 at 2:51
    
yes, that is one of the tiny reasons which motivated my knitr package, which allows you to control the size of your plots easily; see yihui.name/knitr or the manual github.com/downloads/yihui/knitr/knitr-manual.pdf –  Yihui Apr 25 '12 at 5:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.