[Rd] Console colors do not stick (PR#13625)

2009-03-26 Thread laverty
Full_Name: Sean Laverty
Version: R version 2.8.1 (2008-12-22)
OS: os x 10.5.6
Submission from: (NULL) (155.101.41.13)


In the console colors window, colors do not stick when palettes are closed.  All
custom colors are replaced by blue.  I've tried all palettes - crayons, sliders,
wheel, spectrum.

"R.bug.report" 30L, 582C<>--please do not
edit the information below--
Version:
 platform = i386-apple-darwin8.11.1
 arch = i386
 os = darwin8.11.1
 system = i386, darwin8.11.1
 status =
 major = 2
 minor = 8.1
 year = 2008
 month = 12
 day = 22
 svn rev = 47281
 language = R
 version.string = R version 2.8.1 (2008-12-22)
GUI:

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] savePlot export "strange" eps (PR#13620)

2009-03-26 Thread Uwe Ligges



Christophe Genolini wrote:
Sorry for that... I find a strange behavior in "savePlot" ; before 
report a bug, I read the posting guide and I try to simplify my exemple 
as much as possible. Doing this, I change my code and I remove the " 
type='eps' " option... Sorry !


Let's start this again.

When I use savePlot(file="toto.eps",type="eps") and I try to incorporate 
"toto.eps" in a LaTeX document, I get a strange behavior:
LaTeX run normaly, so does dvips. But the generated postscript include a 
graph that overwirte the line above it.

If my latex is

bonjour bonjour2 bonjour3
\begin{center}
\includegraphics[width=12cm]{toto.eps}
\end{center}

Then "bonjour2 bonjour3" is hidden by the graph.



No so for me, but let me (what you still not did), give a reproducible 
example:


I opened some vanilla R-2.8.1 under Windows using

RGui --vanilla

in R:

plot(1:10)
savePlot(file="d:/temp/toto.eps", type="eps")

Then I created a LaTeX document:

\documentclass{article}
\usepackage{graphicx}
\begin{document}
bonjour bonjour2 bonjour3
\begin{center}
 \includegraphics[width=12cm]{toto.eps}
\end{center}
\end{document}


and ran LaTeX and dvips.

All is fine.  So, *please*, specify a reproducible example or we cannot 
help. I presume you have a LaTeX problem. Anyway, a better way to export 
your graphs would be to use a proper device directly - independent of 
what happens here.


And also, this is still not proved to be a bug, particularly not in R!

Uwe Ligges





Version: 2.8.1
OS: Windows XP
LaTeX : Miktex 2.7

Christophe




cgeno...@u-paris10.fr wrote:

Full_Name: Christophe Genolini
Version: 2.8.1
OS: Windows XP
Submission from: (NULL) (82.225.59.146)


savePlot export "eps" graph that seems to be incorrect. 



Looks like you saved an EMF rather than an eps file???

Uwe Ligges



Trying to incorporate them in a LaTeX file, I get : 
++

Cannot determine size of graphics in foo.eps (no BoundingBox)
--

Trying to open them with GSview, I get :
++
GSview 4.9 2007-11-18
AFPL Ghostscript 8.54 (2006-05-17)
Copyright (C) 2005 artofcode LLC, Benicia, CA.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Displaying non DSC file C:/Documents and Settings/Christophe/Mes
documents/Recherche/Trajectoires/kmeal/trajectories/testsDev/toti.eps
Error: /undefined in 
Operand stack:

Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--  
--nostringval--   2   %stopped_push   --nostringval--   
--nostringval--   false  1   %stopped_push   1   3   %oparray_pop   
1   3   %oparray_pop   1   3  %oparray_pop   1   3   %oparray_pop   
.runexec2   --nostringval--  --nostringval--   --nostringval--   2   
%stopped_push   --nostringval--

Dictionary stack:
   --dict:1130/1686(ro)(G)--   --dict:0/20(G)--   --dict:74/200(L)--
Current allocation mode is local
Last OS error: No such file or directory

--- Begin offending input ---
   €      L   z  f  C  fC   EMF   $6  7    
l   �    °    €— ° G r a p h A p p 
%        €%
       €%        €%        €%        €%        €%        
€%       €%        €%        €%        €%        €K   @   
0              N   N   y  @  N   N   y  @  %        
€%        €:     _   8      8   8 
   %              ;            l   *  
6      Z  õ  <      @      f   ï  `  0  %   
    €(         %        €%        €K   @   0         
      N   N  y  @  N   N   y  @  %        €%        €:   
  _   8      8   8%   
           ;            m  ñ  6      Z  »  <      
@      g  µ  `  ÷  %   
    €(         %        €%        €K   @   0         
     ¡  ¡  ¡  ¡  %        €%        €:   
  _   8      8   8    --- End 
offending input ---

file offset = 1024
gsapi_run_string_continue returns -101

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel






__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] typo in sprintf format string segfaults R

2009-03-26 Thread Wacek Kusnierczyk
Sklyar, Oleg (London) wrote:
> typo as simple as %S instead of %s segfaults R devel:
>   

not exactly:

sprintf('%S', 'aa')
# error: unrecognised format at end of string

without a segfault.  but with another format specifier behind, it will
cause a segfault.

interestingly, here's again the same problem i have reported recently: 
that you are given a number of options for how to leave the session, but
you can type ^c and stay in a semi-working session.  (and the next
execution of the above will  then cause a segfault with immediate exit.)

vQ

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] typo in sprintf format string segfaults R

2009-03-26 Thread Sklyar, Oleg (London)
typo as simple as %S instead of %s segfaults R devel:

*** R 2.9.0 (svn -r 47821) [/share/research/R-devel/20090203/lib64/R]
***
> sprintf("%S%d", "aaa", 1)

 *** caught segfault ***
address 0x8000, cause 'memory not mapped'

Traceback:
 1: sprintf("%S%d", "aaa", 1)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

-
> sessionInfo()
R version 2.9.0 Under development (unstable) (2009-02-02 r47821) 
x86_64-unknown-linux-gnu 

locale:
C

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


Dr Oleg Sklyar
Research Technologist
AHL / Man Investments Ltd
+44 (0)20 7144 3107
oskl...@maninvestments.com

**
Please consider the environment before printing this email or its attachments.
The contents of this email are for the named addressees ...{{dropped:19}}

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Error message for matrix(1)[[1,,]]

2009-03-26 Thread Stavros Macrakis
> matrix(1)[[1,]]
Error in matrix(1)[[1, ]] : invalid subscript type 'symbol'

This is of course an incorrect use of [[, but I think the error
message could be more helpful.
I will guess that it is interpreting the missing value indicator as a
symbol, since I get the same error message for

> matrix(1)[[ quote(a=), ]]

  -s

PS quote(a=) seems to be the easiest way to get the missing value
indicator as a value.  Is it by design that it returns the MVI? Or is
it a missing error check?

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] get_all_vars fails with matrices (PR#13624)

2009-03-26 Thread Simon Wood
It's not just lists that are odd...

> X <- matrix(1:15,5,3)
> z <- 26:30
> model.frame(~z+X)
   z X.1 X.2 X.3
1 26   1   6  11
2 27   2   7  12
3 28   3   8  13
4 29   4   9  14
5 30   5  10  15
> get_all_vars(~z+X)
[1] zX 

... which is again a problem when trying to pick up unprocessed versions of 
the variables used by a modelling function   


On Wednesday 25 March 2009 18:54, Peter Dalgaard wrote:
> s.w...@bath.ac.uk wrote:
> > Hi,
> >
> > According to the help file for model.frame/get_all_vars, the following
> > should produce the same output from both functions, but it doesn't...
> >
> >> dat <- list(X=matrix(1:15,5,3),z=26:30)
> >> model.frame(~z+X,dat)
> >
> >z X.1 X.2 X.3
> > 1 26   1   6  11
> > 2 27   2   7  12
> > 3 28   3   8  13
> > 4 29   4   9  14
> > 5 30   5  10  15
> >
> >> get_all_vars(~z+X,dat)
> >
> > [1] zX 
> > <0 rows> (or 0-length row.names)
> >
> > -- the equivalent works ok if there are no matrices involved.
> >
> > I'm using  R version 2.9.0 alpha (2009-03-24 r48212) (Suse linux 10 and
> > 11, 64 bit intel). I found the problem while trying to fix a problem in
> > an mgcv plotting routine.
> >
> > best,
> > Simon
>
> This works, though:
>  > dat <- data.frame(X=I(matrix(1:15,5,3)),z=26:30)
>  > get_all_vars(~z+X,dat)
>
> z X.1 X.2 X.3
> 1 26   1   6  11
> 2 27   2   7  12
> 3 28   3   8  13
> 4 29   4   9  14
> 5 30   5  10  15
>
> but there is something special with lists:
>  > dat <- as.data.frame(list(X=I(matrix(1:15,5,3)),z=26:30))
>  > get_all_vars(~z+X,dat)
>
> z X.1 X.2 X.3
> 1 26   1   6  11
> 2 27   2   7  12
> 3 28   3   8  13
> 4 29   4   9  14
> 5 30   5  10  15
>
>  > dat <- data.frame(list(X=I(matrix(1:15,5,3)),z=26:30))
>  > get_all_vars(~z+X,dat)
>
> z X.1 X.2 X.3
> 1 26   1   6  11
> 2 27   2   7  12
> 3 28   3   8  13
> 4 29   4   9  14
> 5 30   5  10  15
>
>  > dat <- list(X=I(matrix(1:15,5,3)),z=26:30)
>  > get_all_vars(~z+X,dat)
>
> [1] z X
> <0 rows> (or 0-length row.names)

-- 
> Simon Wood, Mathematical Sciences, University of Bath, Bath, BA2 7AY UK
> +44 1225 386603  www.maths.bath.ac.uk/~sw283

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Building R-alpha with ATLAS libraries?

2009-03-26 Thread M. Edward (Ed) Borasky
I'm trying to build R-alpha using the ATLAS libraries as described in
the R-admin manual, section A.3.1.1 (BLAS) and A.3.2 (LAPACK). I built
ATLAS with LAPACK as described in the ATLAS documentation, and the
ATLAS version is the latest, 3.9.10. The platform is openSUSE 11.1
x86_64 with GCC 4.3.2.

"configure" is finding the ATLAS BLAS all right, but it is not finding
the ATLAS LAPACK. The configure command string is

./configure --enable-threads --disable-R-profiling \
  --with-blas="-L/usr/local/atlas/lib -lptf77blas -lpthread -latlas" \
  --with-lapack="-L/usr/local/atlas/lib -llapack -lptcblas" \
  --with-tcltk --with-cairo --with-libpng --with-jpeglib --with-x \
  2>&1 | tee ../R-alpha-config.log

Here's what's in the "R-alpha-config.log" file when it gets to the
library check part:

checking for dgemm_ in -L/usr/local/atlas/lib -lptf77blas -lpthread
-latlas... yes
checking whether double complex BLAS can be used... yes
checking whether the BLAS is complete... yes
checking for zgeev_... no
checking for zgeev_ in -L/usr/local/atlas/lib -llapack -lptcblas... no
checking for zgeev_ in -llapack... no

I looked in "R-alpha/config.log" and it looks like "configure" is not
searching the right libraries for "zgeev_":

configure:38501: checking for zgeev_
configure:38565: gcc -std=gnu99 -o conftest -O3 -march=native -g -pipe
 -I/usr/local/include  -L/usr/local/lib64 conftest.c
-L/usr/local/atlas/lib -lptf77blas -lpthread -latlas  -lgfortran -lm
-ldl -lm  >&5
/tmp/ccETmjPn.o: In function `main':
/home/Projects/linux_perf_viz/build-scripts/R-alpha/conftest.c:218:
undefined reference to `zgeev_'
collect2: ld returned 1 exit status
configure:38571: $? = 1

I checked the ATLAS libraries and "zgeev_" is there. Did I miss
something in the "configure" parameters?
-- 
M. Edward (Ed) Borasky
http://www.linkedin.com/in/edborasky

I've never met a happy clam. In fact, most of them were pretty steamed.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] [R] "[.data.frame" and lapply

2009-03-26 Thread Romain Francois

[moving this from R-help to R-devel]

Hi,

Right, so when you call `[`, the dispatch is made internally :

> d <- data.frame( x = 1:5, y = rnorm(5), z = rnorm(5) )
> trace( `[.data.frame` )
> d[ , 1:2]   # ensuring the 1:2 is passed to j and the i is passed as 
missing

Tracing `[.data.frame`(d, , 1:2) on entry
 x   y
1 1  0.98946922
2 2  0.05323895
3 3 -0.21803664
4 4 -0.47607043
5 5  1.23366151

> d[ 1:2] # only on argument, so it goes in i
Tracing `[.data.frame`(d, 1:2) on entry
 x   y
1 1  0.98946922
2 2  0.05323895
3 3 -0.21803664
4 4 -0.47607043
5 5  1.23366151

But that does not explain why this is hapening:

> d[ i = 1:2]
Tracing `[.data.frame`(d, i = 1:2) on entry
 x   y
1 1  0.98946922
2 2  0.05323895
3 3 -0.21803664
4 4 -0.47607043
5 5  1.23366151

> d[ j = 1:2]
Tracing `[.data.frame`(d, j = 1:2) on entry
 x   y  z
1 1  0.98946922 -0.5233134
2 2  0.05323895  1.3646683
3 3 -0.21803664 -0.4998344
4 4 -0.47607043 -1.8849618
5 5  1.23366151  0.6723562

Arguments are dispatched to `[.data.frame` with their names, and 
`[.data.frame` gets confused. I'm not suggesting allowing named 
arguments because it already works, what does not work is how 
`[.data.frame` treats them, and that needs to be changed, this is a bug.


Romain

> version
  _
platform   i686-pc-linux-gnu
arch   i686
os linux-gnu
system i686, linux-gnu
status Under development (unstable)
major  2
minor  9.0
year   2009
month  03
day09
svn rev48093
language   R
version.string R version 2.9.0 Under development (unstable) (2009-03-09 
r48093)





baptiste auguie wrote:

Hi,

I got an off-line clarification from Martin Morgan which makes me 
believe it's not a bug (admittedly, I was close to suggesting it before).


Basically, "[" is a .Primitive, for which the help page says,


The advantage of |.Primitive| over |.Internal 
| functions 
is the potential efficiency of argument passing. However, this is 
done by ignoring argument names and using positional matching of 
arguments (unless arranged differently for specific primitives such 
as |rep 
|), 
so this is discouraged for functions of more than one argument.


This explains why in my tests the argument names i and j were 
completely ignored and only the number and order of arguments changed 
the result. 

I've learnt my lesson here, but I wonder what could be done to make 
this discovery easier for others:


- add a note in the documentation of each .Primitive function (at 
least a link to ?.Primitive)


- add such an example in lapply (all examples are for named arguments)

- echo a warning if trying to pass named arguments to a .Primitive

- allow for named arguments as you suggest

I'm not sure the last two would be possible without some cost in 
efficiency.



Many thanks,

baptiste




On 26 Mar 2009, at 07:46, Romain Francois wrote:



Hi,

This is a bug I think. [.data.frame treats its arguments differently
depending on the number of arguments.


d <- data.frame(x = rnorm(5), y = rnorm(5), z = rnorm(5) )
d[, 1:2]

x   y
1   0.45141341  0.03943654
2  -0.87954548  1.83690210
3  -0.91083710  0.22758584
4   0.06924279  1.26799176
5  -0.20477052 -0.25873225

base:::`[.data.frame`( d, j=1:2)

x   y  z
1   0.45141341  0.03943654 -0.8971957
2  -0.87954548  1.83690210  0.9083281
3  -0.91083710  0.22758584 -0.3104906
4   0.06924279  1.26799176  1.2625699
5  -0.20477052 -0.25873225  0.5228342
but also:

d[ j=1:2]

   x   y  z
1  0.45141341  0.03943654 -0.8971957
2 -0.87954548  1.83690210  0.9083281
3 -0.91083710  0.22758584 -0.3104906
4  0.06924279  1.26799176  1.2625699
5 -0.20477052 -0.25873225  0.5228342

`[.data.frame` only is called with two arguments in the second case, so
the following condition is true:

if(Narg < 3L) {  # list-like indexing or matrix indexing

And then, the function assumes the argument it has been passed is i, and
eventually calls NextMethod("[") which I think calls
`[.listof`(x,i,...), since i is missing in `[.data.frame` it is not
passed to `[.listof`, so you have something equivalent to as.list(d)[].

I think we can replace the condition with this one:

if(Narg < 3L && !has.j) {  # list-like indexing or matrix indexing

or this:

if(Narg < 3L) {  # list-like indexing or matrix indexing
   if(has.j) i <- j


`[.data.frame`(d, j=1:2)

   x   y
1  0.45141341  0.03943654
2 -0.87954548  1.83690210
3 -0.91083710  0.22758584
4  0.06924279  1.26799176
5 -0.20477052 -0.25873225

However, we would still have this, which is expected (same as d[1:2] ):


`[.data.frame`(d, i=1:2)

   x   y
1  0.45141341  0.03943654
2 -0.87954548  1.83690210
3 -0.91083710  0.22758584
4  0.06924279  1.26799176
5 -0.20477052 -0.25873225

Romain

baptiste auguie wrote:

Dear all,


Trying to extract a few rows for each element of a list of
dat