[R] axis date format in lattice

2007-01-10 Thread karl . sommer
Hello list,

plotting the following example 1 in lattice only labels the x-axis with one
tick mark at the beginning of February.
In contrast the standard plot() function labels the x-axis with equally
spaced tick marks.

#example 1 ---
library(lattice)
date - as.Date(c(1/10/2006, 01/11/2006, 01/12/2006,
  01/01/2007, 01/02/2007),format=%d/%m/%Y)
xx - c(1,3,5,6,7)
xx1 - as.data.frame(cbind(date, xx))
xyplot(xx~date, scales=list(x=list(format = %b)))
plot(xx~date)

Interestingly the behaviour in lattice only seems to arise when there is a
change in calendar years.  This is demonstrated by the second example with
dates from within 1 calendar year only where lattice works as expected.

I was wondering if the behaviour in example 1 was due to a bug or am I
missing something and, more importantly, is there a way around it?

#---example 2 ---
date - as.Date(c(1/08/2006, 01/09/2006, 01/10/2006,
  01/11/2006, 01/12/2006),format=%d/%m/%Y)
xx - c(1,3,5,6,7)
xx1 - as.data.frame(cbind(date, xx))
xyplot(xx~date, scales=list(x=list(format = %b)))
plot(xx~date)

Cheers
Karl

_
Dr Karl J Sommer,
Department of Primary Industries,
Catchment  Agriculture Services,
PO Box 905
Mildura, VIC, Australia 3502

Tel: +61 (0)3 5051 4390
Fax +61 (0)3 5051 4534

Email: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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] R grahics: Save as hangs computer

2007-01-04 Thread karl . sommer

Hello,

thanks for the advice.  I was aware that the version was out of date and
your message prompted me to finally upgrade to the latest version 2.4.1.
Unfortunately, running R under Emacs ESS, the problem I described earlier
persists.

I have also tried the Save as option under the standard RGui interface and
this worked in both the old and the new versions of R, 2.3.0 and 2.4.1
respectively.  The problem seems to be associated with Emacs ESS.  However
I don't have a clue where to start in order to find a solution.

In general I quite like using Emacs ESS.  It provides syntax highlighting
and this makes scripts far easier to read than with the standard editor
that comes with RGui.

I would be grateful for any further hints from someone who has encountered
similar problems in running R 2.4.1 through Emacs ESS 5.3.3 under Windows
2000.

Regards

Karl



|-+
| |   [EMAIL PROTECTED]|
| |   .ca  |
| ||
| |   04/01/2007 10:10 |
| ||
|-+
  
--|
  | 
 |
  |   To:   [EMAIL PROTECTED]   
|
  |   cc:   r-help@stat.math.ethz.ch
 |
  |   Subject:  Re: [R] R grahics: Save as hangs computer   
 |
  
--|




On 1/3/2007 5:30 PM, [EMAIL PROTECTED] wrote:
 Hello list,

 I have encountered a problem trying to save graphs using the R-graphics
 menu:  File|Save as.  The menu suggests that files may be saved as either
 Metafile, Postscript, pdf, png, bmp, jpeg.
 When I specify any of those file formats a menu comes up requesting a
file
 name.  After providing a name R invariably hangs and has to be restarted.

 I am able to save files under the various formats using the command line
 without problems.  However, sometimes it would be convenient to use the
 menus.

 I was wondering if anyone else had encountered a similar behaviour and
had
 found a remedy.

 I am running are under GNU-Emacs ESS 5.3.3.

 sessionInfo()
 Version 2.3.0 (2006-04-24)

That version is out of date.  Could you please update to the current
version (2.4.1), and see if the problem persists?  If so, could you
please try it when running Rterm or Rgui on its own, rather than running
under Emacs?

Thanks.

Duncan Murdoch

 i386-pc-mingw32

 attached base packages:
 [1] methods   stats graphics  grDevices utils
datasets
 [7] base

 other attached packages:
  lattice
 0.13-8

 Regards

 Karl

 _
 Dr Karl J Sommer,
 Department of Primary Industries,
 Catchment  Agriculture Services,
 PO Box 905
 Mildura, VIC, 3502
 Australia

 Tel: +61 (0)3 5051 4390
 Fax +61 (0)3 5051 4534

 Email: [EMAIL PROTECTED]

 __
 R-help@stat.math.ethz.ch 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-help@stat.math.ethz.ch 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] R grahics: Save as hangs computer

2007-01-04 Thread karl . sommer

Hello list

thanks for that advice Rich.  You are right a few control-G allowed me to
recover and it had saved an eps file.

The dev.copy2eps appears to take exactly what is visible in the graphics
window and convert it to an eps file. This does the job for the moment.

Opening the eps file in GSview I noticed that there is still a lot of white
space in the bounding box which creates empty space when I want to include
the image into a tex document.  Is there a way to crop the image to remove
the white space before including it in a document?

Cheers

Karl



|-+
| |   [EMAIL PROTECTED]   |
| ||
| |   05/01/2007 10:03 |
| ||
|-+
  
--|
  | 
 |
  |   To:   [EMAIL PROTECTED], [EMAIL PROTECTED]
 |
  |   cc:   r-help@stat.math.ethz.ch, [EMAIL PROTECTED] 
|
  |   Subject:  Re: [R] R grahics: Save as hangs computer   
 |
  
--|




The good news, you don't have to shut down R.  Several control-G in
the *R* buffer in emacs will recover control.  A second attempt in the
same GUI graphics device did get the postscript file saved.

A workaround for this problem is to use the command line, rather than
the GUI menu, to save the file.  This line
dev.copy2eps()
works.

I discovered that it is necessary to set
   options(chmhelp=FALSE)
when running R from emacs as the chmhelp is also freezing R
and the help system.  I am using  R-2.4.1 on Windows.

Use
   ?dev.copy2eps
for details on the command line dev.* commands.

Follow-up should go to the ess-bugs mailing list.

Rich

__
R-help@stat.math.ethz.ch 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] R grahics: Save as hangs computer

2007-01-03 Thread karl . sommer
Hello list,

I have encountered a problem trying to save graphs using the R-graphics
menu:  File|Save as.  The menu suggests that files may be saved as either
Metafile, Postscript, pdf, png, bmp, jpeg.
When I specify any of those file formats a menu comes up requesting a file
name.  After providing a name R invariably hangs and has to be restarted.

I am able to save files under the various formats using the command line
without problems.  However, sometimes it would be convenient to use the
menus.

I was wondering if anyone else had encountered a similar behaviour and had
found a remedy.

I am running are under GNU-Emacs ESS 5.3.3.

 sessionInfo()
Version 2.3.0 (2006-04-24)
i386-pc-mingw32

attached base packages:
[1] methods   stats graphics  grDevices utils datasets
[7] base

other attached packages:
 lattice
0.13-8

Regards

Karl

_
Dr Karl J Sommer,
Department of Primary Industries,
Catchment  Agriculture Services,
PO Box 905
Mildura, VIC, 3502
Australia

Tel: +61 (0)3 5051 4390
Fax +61 (0)3 5051 4534

Email: [EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch 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.