Re: [R] Sweave and ggplot2

2008-08-04 Thread Sorn . Norng
Dear Thierry,

Your guess was correct. I was not aware that I needed print( ). It was not 
needed with plot( ). I have yet to try xyplot( ) but I suspect that the 
print( ) might be needed here as well. Thank you very much for your help.

Cheers,

Sorn




"ONKELINX, Thierry" <[EMAIL PROTECTED]> 
04/08/2008 06:02 PM

To
<[EMAIL PROTECTED]>, 
cc

Subject
RE: [R] Sweave and ggplot2






Dear Sorn, 

It's hard to guess what your problem is, as you don't provide any sample
code. My guess is that the graphics are empty. Did you use
print(qplot(...)) or just qplot(). The latter won't work. You need
print(qplot(...))

HTH,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens [EMAIL PROTECTED]
Verzonden: maandag 4 augustus 2008 6:55
Aan: r-help@r-project.org
Onderwerp: [R] Sweave and ggplot2

Hi all,

I've been trying to run Sweave with R code embedded - using the ggplot2 
package and in particular the qplot command. There appears to be a
problem 
in Sweave not picking up that qplot is a function. Has anybody else
tried 
to use qplot in Sweave and have you been successful? Any help would be 
very much appreciated.

Kind Regards,

Sorn


Notice:
This email and any attachments may contain information\ ...{{dropped:26}}

__
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.


Re: [R] Sweave and ggplot2

2008-08-04 Thread ONKELINX, Thierry
Dear Sorn, 

It's hard to guess what your problem is, as you don't provide any sample
code. My guess is that the graphics are empty. Did you use
print(qplot(...)) or just qplot(). The latter won't work. You need
print(qplot(...))

HTH,

Thierry



ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium 
tel. + 32 54/436 185
[EMAIL PROTECTED] 
www.inbo.be 

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Namens [EMAIL PROTECTED]
Verzonden: maandag 4 augustus 2008 6:55
Aan: r-help@r-project.org
Onderwerp: [R] Sweave and ggplot2

Hi all,

I've been trying to run Sweave with R code embedded - using the ggplot2 
package and in particular the qplot command. There appears to be a
problem 
in Sweave not picking up that qplot is a function. Has anybody else
tried 
to use qplot in Sweave and have you been successful? Any help would be 
very much appreciated.

Kind Regards,

Sorn


Notice:
This email and any attachments may contain information\ ...{{dropped:10}}

__
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.


[R] Sweave and ggplot2

2008-08-03 Thread Sorn . Norng
Hi all,

I've been trying to run Sweave with R code embedded - using the ggplot2 
package and in particular the qplot command. There appears to be a problem 
in Sweave not picking up that qplot is a function. Has anybody else tried 
to use qplot in Sweave and have you been successful? Any help would be 
very much appreciated.

Kind Regards,

Sorn


Notice:
This email and any attachments may contain information t...{{dropped:14}}

__
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.


Re: [R] Sweave and ggplot2

2007-09-25 Thread Julien Barnier
Hi Ken,

> This might be a case of FAQ 7.22 since ggplot(2) like lattice depend on grid.
> I would try wrapping the ggplot commands in a print statement.

Yes, you're right. Replacing :

<>=
ggplot(d,aes(y=t,x=u)) + geom_point(colour=alpha('black', 0.05))
@

with :

<>=
print(ggplot(d,aes(y=t,x=u)) + geom_point(colour=alpha('black', 0.05)))
@

made the whole thing work.

Thanks a lot !

Julien

-- 
Julien Barnier
Groupe de recherche sur la socialisation
ENS-LSH - Lyon, France

__
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.


Re: [R] Sweave and ggplot2

2007-09-25 Thread Ken Knoblauch
Julien Barnier  no-log.org> writes:

> 
> Hi,
> When I try this example at work, I got an error message during Sweave
> which is close from something like "warning : semitransparency not
> supported by this device". When I try at home (with the given
> sessionInfo), I got no warning but in both the cases the result is the
> same : an empty pdf file for the figure and an error during pdflatex
> compilation.
> 
> I've put online an example Rnw file and the almost empty pdf produced
> here :
> 
> http://dd.nozav.org/transferts/
> 
> Thanks in advance for any help.

This might be a case of FAQ 7.22 since ggplot(2) like lattice depend on grid.
I would try wrapping the ggplot commands in a print statement.

HTH,

ken

__
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.


Re: [R] Sweave and ggplot2

2007-09-24 Thread Julien Barnier
Hi,

First, thanks for your help and sorry for not following the posting
guide by not giving more detailed informations and an easily
reproducible example...

> i) Despite its annoncment in fortune("mind_read"), the mind_read()
> function is apparently not to be released in R 2.6.0, so that if
> you could just follow the posting guide and give a reproducible
> example...

Well, I hope it will be ready for R 2.7.0 !

> ii) Give the output of your sessionInfo(). You can use something
> like that in your *.rnw file:
>
> <>=
> toLatex(sessionInfo())
> @

Here it is :

,
| R version 2.5.1 (2007-06-27) 
| i486-pc-linux-gnu 
| 
| locale:
| [EMAIL PROTECTED];LC_NUMERIC=C;[EMAIL PROTECTED];[EMAIL PROTECTED];
| [EMAIL PROTECTED];[EMAIL PROTECTED];[EMAIL PROTECTED];LC_NAME=C;
| LC_ADDRESS=C;LC_TELEPHONE=C;[EMAIL PROTECTED];LC_IDENTIFICATION=C
| 
| attached base packages:
| [1] "grDevices" "utils" "datasets"  "graphics"  "stats" "methods"  
| [7] "base" 
| 
| other attached packages:
| car 
| "1.2-1" 
`

> iii) What do you mean exactly by "doesn't work"? Put the source and
> the output somewhere on the web so that we can see both.

"Doesn't work" means that the generated pdf file for the figure
generated by the chunk is empty. It is not of size 0, but it has no
content and so cannot be included when running pdflatex, which exits
with an error :

,
| !pdfTeX error: pdflatex (file ./alpha_sweave-004.pdf): PDF inclusion: 
required 
| page does not exist <0>
|  ==> Fatal error occurred, no output PDF file produced!
`

When I try this example at work, I got an error message during Sweave
which is close from something like "warning : semitransparency not
supported by this device". When I try at home (with the given
sessionInfo), I got no warning but in both the cases the result is the
same : an empty pdf file for the figure and an error during pdflatex
compilation.

I've put online an example Rnw file and the almost empty pdf produced
here :

http://dd.nozav.org/transferts/

Thanks in advance for any help.

-- 
Julien

__
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.


Re: [R] Sweave and ggplot2

2007-09-24 Thread Jean lobry
Dear Julien,

>  Hi,
>
>  I am trying to use ggplot2 graphics with Sweave, but I got problems
>  with transparency support when generating pdf figures, even if I
>  specify a ?pdf.version? argument in Sweave options.
>
[...snip...]

I wanted to help because I'm interested by the exploitation
of the alpha channel in Sweave documents too...

However,

i) Despite its annoncment in fortune("mind_read"), the mind_read()
function is apparently not to be released in R 2.6.0, so that if
you could just follow the posting guide and give a reproducible
example...

ii) Give the output of your sessionInfo(). You can use something
like that in your *.rnw file:

<>=
toLatex(sessionInfo())
@

iii) What do you mean exactly by "doesn't work"? Put the source and
the output somewhere on the web so that we can see both.

Sincerely,
-- 
Jean R. Lobry([EMAIL PROTECTED])
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - LYON I,
43 Bd 11/11/1918, F-69622 VILLEURBANNE CEDEX, FRANCE
allo  : +33 472 43 27 56 fax: +33 472 43 13 88
http://pbil.univ-lyon1.fr/members/lobry/

__
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.


[R] Sweave and ggplot2

2007-09-24 Thread Julien Barnier
Hi,

I am trying to use ggplot2 graphics with Sweave, but I got problems
with transparency support when generating pdf figures, even if I
specify a «pdf.version» argument in Sweave options.


More precisely, forcing the pdf version by creating the file manually
works :

<>=
pdf(version="1.4",file="foo.pdf")
ggplot(d,aes(y=t,x=u)) + geom_point(colour=alpha('black', 0.05))
dev.off()
@ 
\includegraphics{foo.pdf}


Using the pdf.version argument without using ggplot works, too :

\SweaveOpts{echo=FALSE,pdf.version=1.4}
<>=
plot(t,u,col=rgb(0,0,0,0.1))
@ 


But the following doesn't work (and this is what I would like to do) :

\SweaveOpts{echo=FALSE,pdf.version=1.4}
<>=
ggplot(d,aes(y=t,x=u)) + geom_point(colour=alpha('black', 0.05))
@ 


Does anyone have an idea about this ?

Thanks in advance,

Julien

-- 
Julien Barnier
Groupe de recherche sur la socialisation
ENS-LSH - Lyon, France

__
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.