Re: [R] having problems with factor()

2007-08-10 Thread Rainer Hurling
I am afraid the above example will not work. In original dataset of 
Jabez Wilson numerical range is from 0..7.

So try this one:

df<-as.factor(c("0","I","II","III","IV","V","VI","VII")[df$area+1])

Hope this is what you want,
Rainer


Henrique Dallazuanna schrieb:
> Hi,
> 
> df
> ht area
> 1  3203
> 2  4104
> 3  2302
> 4  3603
> 5  1261
> 6  2802
> 7  2602
> 8  2802
> 9  2802
> 10 2602
> 
> df$area <- as.factor(df$area)
> levels(df$area) <- c("I", "II", "III", "IV")
 >
 >
 > On 10/08/07, Jabez Wilson <[EMAIL PROTECTED]> wrote:
 >> Dear R Help,
 >> I have a set of data of heights of trees described by area that they 
 >> are in. The areas are numerical (0 to 7).
 >>
 >> htarea
 >> 1   320   3
 >> 2   410   4
 >> 3   230   2
 >> 4   360   3
 >> 5   126   1
 >> 6   280   2
 >> 7   260   2
 >> 8   280   2
 >> 9   280   2
 >> 10  260   2
 >> ...
 >> 180 450   4
 >> 181  90   1
 >> 182 120   1
 >> 183 440   4
 >> 184 210   2
 >> 185 330   3
 >> 186 210   2
 >> 187 100   1
 >> 188   0   0
 >>
 >> I want to convert the area column values to factors, to do an anova.
 >> However, if I use:
 >>
 >> df$areaf <- factor(df$area,
 >> labels=c("0","I","II","III","IV","V","VI","VII"))
 >>
 >> it gives the following message:
 >>
 >> Error in factor(df$area, labels = c("0", "I", "II", "III", "IV", "V",
 >> "VI",  :
 >> invalid labels; length 8 should be 1 or 7
 >>
 >> Can anyone help?
 >>
 >> Jabez

__
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] compile errors with rgl-0.70.570 on FreeBSD

2007-04-08 Thread Rainer Hurling
Bernardo,

thank you for your tips. But before version 0.70.570 rgl was running 
fine on my system. All necessary GL files are installed.

Duncan Murdoch is working on a configure script to get rgl also work on 
Mac OSX. Some of his changes breaks things for FreeBSD. We tested it 
without posting on [EMAIL PROTECTED]

Duncan now tries to find a solution for all platforms.

Rainer Hurling


Bernardo Rangel Tura schrieb:
> On Wed, 2007-04-04 at 21:12 +0200, Rainer Hurling wrote:
>> Thank you for your work on rgl.
>>
>> Reading in another thread about your new (inofficial) version of rgl 
>> (see below) I tried it with R version 2.5.0 alpha (2007-03-31 r40986) 
>> under FreeBSD 7.0-CURRENT. Unfortunately I got the following error:
>>
>> ---
>> #R CMD INSTALL rgl_0.70.570.tar.gz
>> * Installing to library '/usr/local/lib/R/library'
>> * Installing *source* package 'rgl' ...
>> checking for libpng-config... yes
>> configure: using libpng-config
>> configure: using libpng dynamic linkage
>> checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
>> checking GL/gl.h usability... no
>> checking GL/gl.h presence... no
>> checking for GL/gl.h... no
>> checking GL/glu.h usability... no
>> checking GL/glu.h presence... no
>> checking for GL/glu.h... no
>> configure: error: missing required header GL/gl.h
>> ERROR: configuration failed for package 'rgl'
>> ** Removing '/usr/local/lib/R/library/rgl'
>> ** Restoring previous '/usr/local/lib/R/library/rgl'
>> ---
> 
> Rainer,
> 
> I have same problem in my Ubuntu.
> I solve instaling OpenGl in system, in my case I install this debian
> poackages:
> 
> freeglut3, freeglut3-dev, libgl1-mesa-dev, libglu1-mesa-dev, libice-dev,
> libsm-dev, libx11-dev, libxau-dev, libxdmcp-dev, libxext-dev, libxt-dev,
> mesa-common-dev, x11proto-core-dev, x11proto-input-dev, x11proto-kb-dev,
> x11proto-xext-dev, xlibmesa-gl-dev and xtrans-dev
> 
> If you install similar packages in your system  I think your problem
> will be solve.
>

__
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] compile errors with rgl-0.70.570 on FreeBSD

2007-04-04 Thread Rainer Hurling
Thank you for your work on rgl.

Reading in another thread about your new (inofficial) version of rgl 
(see below) I tried it with R version 2.5.0 alpha (2007-03-31 r40986) 
under FreeBSD 7.0-CURRENT. Unfortunately I got the following error:

---
#R CMD INSTALL rgl_0.70.570.tar.gz
* Installing to library '/usr/local/lib/R/library'
* Installing *source* package 'rgl' ...
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking GL/gl.h usability... no
checking GL/gl.h presence... no
checking for GL/gl.h... no
checking GL/glu.h usability... no
checking GL/glu.h presence... no
checking for GL/glu.h... no
configure: error: missing required header GL/gl.h
ERROR: configuration failed for package 'rgl'
** Removing '/usr/local/lib/R/library/rgl'
** Restoring previous '/usr/local/lib/R/library/rgl'
---

This version is not able to find any GL files on my system.

I did not have any problems compiling rgl_0.70.564.tar.gz.

If I can test anything please let me know.

Rainer



 > You can get one slightly more current than the most current release from
 > my web page, .  It has
 > the following changes, which may impact you:
 >
 > v0.70.570
 >- changes to configure script from Laszlo Kajan and Brian Ripley:
 > should
 >  now be much more portable
 >- removed deprecated OSX font setting calls
 >- texture properties are now returned by material3d()
 >- allowed normals and texture coordinates to be specified in
 > triangles and quads
 >- normals may be specified in qmesh objects, but (at present)
 > subdivide removes them
 >- material3d() now preserves the values of unspecified parameters (as
 > documented,
 >  but not previously functioning)
 >- clear3d() can now reset material properties to the defaults, and
 >  open3d() does this.
 >- minor fix for gcc 4.3 compatibility
 >
 > Duncan Murdoch

__
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] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Dirk,

I agree with you. My statements were only related to rgl on FreeBSD. 
With the changes from Brian since yesterday I am finally able to compile 
and work with this package on all our FreeBSD scientific desktops.

At the same time I am very conscious about the great job of Daniel and 
Duncan. Without there work we would not have rgl :-)

Rainer


Dirk Eddelbuettel schrieb:
> FWIW, Debian had working rgl packages since March 2004 -- version 0.64.
> 
> So I respectfully disagree with the general state of despair regarding
> the source package.  I had my build issues at times, but Daniel and
> Duncan worked hard and diligently to overcome these. 
> 
> Hence, "apt-get install r-cran-rgl" may be all it takes to play with
> rgl, at least on Debian and its derivatives such as Ubuntu et al
> 
> Dirk
>

__
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] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Just another note:

rgl_0.70-2 works also for R-2.5.0 on FreeBSD 7.0-CURRENT (amd64) and for 
R-2.4.1 on (i386).

Rainer


Prof Brian Ripley wrote:
> This looks to me like a problem in your OpenGL, I am afraid.
> 
> I've made available a (completely unofficial) revised tarball at
> 
> http://www.stats.ox.ac.uk/pub/R/rgl_0.70-2.tar.gz
> 
> that attempts to work around various configure issues.  Not only does it 
> assume a vanilla make, it also tests if the various headers and 
> libraries are actually present (without assuming they are in .../lib, 
> which they are not on my main system).  So the enquiry with originally 
> started this thread will get a clear error from configure about what is 
> wrong.
> 
> Duncan: I have left in -Iext in PKG_CPPFLAGS, but AFAICS it is only 
> needed on Windows.  We've lost the ability to use a static libpng unless 
> we have libpng-config:  that is I am afraid inevitable as there is no 
> way to find where it might be, and you can't just grab a object of the 
> right name on a multi-architecture system.  Actually, I think it is 
> fundamentally broken as only on a few systems would a static library be 
> PIC (and as i386 Linux with recent gcc is one of those, people tend to 
> forget that).
> 
> Brian Ripley

__
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] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Brian,

I just tried your version rgl_0.70-2 with R-2.5.0 on FreeBSD 7.0-CURRENT 
(i386) and it works!

Thank you very much for this competently and very fast help.

Next I will try if it compiles on amd64, too ...

Rainer


Prof Brian Ripley schrieb:
> This looks to me like a problem in your OpenGL, I am afraid.
> 
> I've made available a (completely unofficial) revised tarball at
> 
> http://www.stats.ox.ac.uk/pub/R/rgl_0.70-2.tar.gz
> 
> that attempts to work around various configure issues.  Not only does it 
> assume a vanilla make, it also tests if the various headers and 
> libraries are actually present (without assuming they are in .../lib, 
> which they are not on my main system).  So the enquiry with originally 
> started this thread will get a clear error from configure about what is 
> wrong.
> 
> Duncan: I have left in -Iext in PKG_CPPFLAGS, but AFAICS it is only 
> needed on Windows.  We've lost the ability to use a static libpng unless 
> we have libpng-config:  that is I am afraid inevitable as there is no 
> way to find where it might be, and you can't just grab a object of the 
> right name on a multi-architecture system.  Actually, I think it is 
> fundamentally broken as only on a few systems would a static library be 
> PIC (and as i386 Linux with recent gcc is one of those, people tend to 
> forget that).
> 
> Brian Ripley
> 
> On Wed, 21 Feb 2007, Hiroyuki Kawakatsu wrote:
> 
>> Hi Rainer,
>>
>> Have you had any luck after Prof Ripley's suggested fix? I am on
>> FreeBSD 6.2 (amd64) and cannot get rgl to work either. With the
>> suggested fix and after commenting out the log2() declaration in
>> math.h, the package builds but segfaults when running the examples in
>> R CMD check. (I have contacted one of the maintainers about this a
>> while back on an earlier version of rgl but no response.) If you had
>> success, are you on a 32bit or 64bit system?
>>
>> h.
>>
>> * checking examples ... ERROR
>> Running examples in 'rgl-Ex.R' failed.
>> The error most likely occurred in:
>>
>>> ### * 3dobjects
>>>
>>> flush(stderr()); flush(stdout())
>>>
>>> ### Name: points3d
>>> ### Title: add primitive set shape
>>> ### Aliases: points3d lines3d segments3d triangles3d quads3d
>>> ### Keywords: dynamic
>>>
>>> ### ** Examples
>>>
>>> # Show 12 random vertices in various ways.
>>>
>>> M <- matrix(rnorm(36), 3, 12, dimnames=list(c('x','y','z'),
>> +rep(LETTERS[1:4], 3)))
>>>
>>> # Force 4-tuples to be convex in planes so that quads3d works.
>>>
>>> for (i in c(1,5,9)) {
>> + quad <- as.data.frame(M[,i+0:3])
>> + coeffs <- runif(2,0,3)
>> + if (mean(coeffs) < 1) coeffs <- coeffs + 1 - mean(coeffs)
>> + quad$C <- with(quad, coeffs[1]*(B-A) + coeffs[2]*(D-A) + A)
>> + M[,i+0:3] <- as.matrix(quad)
>> + }
>>>
>>> open3d()
>> [1] 1
>>>
>>> # Rows of M are x, y, z coords; transpose to plot
>>>
>>> M <- t(M)
>>> shift <- matrix(c(-3,3,0), 12, 3, byrow=TRUE)
>>>
>>> points3d(M, size=2)
>>
>> *** caught segfault ***
>> address 0x0, cause 'unknown'
>>
>> Traceback:
>> 1: .C(rgl_primitive, success = as.integer(FALSE), idata,
>> as.numeric(vertex), NAOK = TRUE)
>> 2: rgl.primitive("points", x, y, z, ...)
>> 3: rgl.points(x = c(-0.626453810742332, 1.59528080213779,
>> 2.00575308060846, -0.305388387156356, -0.621240580541804,
>> -0.0449336090152309, 3.95860460385714, 0.782136300731067,
>> 0.61982574789471, -1.47075238389927, -5.58920873034883,
>> -0.0538050405829051, 0.183643324222082, 0.329507771815361,
>> 1.66524706227070, 1.51178116845085, -2.2146998871775,
>> -0.0161902630989461, 7.05452342645083, 0.0745649833651906,
>> -0.0561287395290008, -0.47815005510862, -2.69588540023329,
>> -1.37705955682861, -0.835628612410047, -0.820468384118015,
>> 0.407234134716211, 0.389843236411431, 1.12493091814311,
>> 0.94383621068530, -7.46953644668121, -1.98935169586337,
>> -0.155795506705329, 0.417941560199702, 1.02866050611420,
>> -0.41499456329968), y = NULL, z = NULL, color = "#00", alpha =
>> numeric(0), lit = TRUE, ambient = "#00", specular = "#FF",
>> emission = "#00", shininess = 50, smooth = TRUE, front = "filled",
>>   back = "filled", size = 2, fog = FALSE)
>> 4: do.call("rgl.points", c(list(x = x, y = y, z = z),
>> .fixMaterialArgs(..., Params = save)))
>> 5: points3d(M, size = 2)
>> aborting ...
>>
>>
>>
>> Message: 53
>> Date: Tue, 20 Feb 2007 21:45:55 + (GMT)
>> From: Prof Brian Ripley <[EMAIL PROTECTED]>
>> Subject: Re: [R] Installing Package rgl - Compilation Fails - FreeBSD
>>
>> The problem is that rgl is apparently written for GNU make, and has (as
>> shipped)
>>
>> ifdef MAKINGAGL
>> [EMAIL PROTECTED]@ -Iext
>> [EMAIL PROTECTED]@
>> else
>> PKG_CPPFLAGS= -If:/R/R-2.4.1/src/extra/zlib -DHAVE_PNG_H
>> -If:/R/R-2.4.1/src/gnuwin32/bitmap/libpng  -Iext
>> PKG_LIBS=-lgdi32 -lopengl32 -lglu32
>> -Lf:/R/R-2.4.1/src/gnuwin32/bitmap/libpng -
>> lpng -Lf:/R/R-2.4.1/src/extra/zlib -lz
>> endif
>>
>> and similar for BUILDAGL.
>

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-21 Thread Rainer Hurling
Brian,

thank you for the adaptions. I tried the new version under R-2.5.0 
(2007-01-23 r40560) on FreeBSD 7.0-CURRENT and got the following output.


-
#R CMD INSTALL rgl_0.70-1.tar.gz
* Installing to library '/usr/local/lib/R/library'
* Installing *source* package 'rgl' ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -I/usr/local/lib/R/include -I/usr/local/lib/R/include 
-I/usr/X11R6/include -DHAVE_PNG_H
-I/usr/local/include/libpng -Iext -I/usr/local/include-fpic  -g -O2 
-c BBoxDeco.cpp -o BBoxDeco.o
In file included from BBoxDeco.hpp:11,
  from BBoxDeco.cpp:1:
math.h: In function `T math::log2(T)':
math.h:43: error: `::log2' has not been declared
*** Error code 1

Stop in /tmp/R.INSTALL.hVDVXM/rgl/src.
chmod: /usr/local/lib/R/library/rgl/libs/*: No such file or directory
ERROR: compilation failed for package 'rgl'
** Removing '/usr/local/lib/R/library/rgl'
-


It seems there is a problem with math.h. The FreeBSD manual for math(3) 
says:

   The log2() and nan() functions are missing, and many functions
   are not available in their long double variants.


I do not know how to locate the library that contains function log2, 
sorry. What can I do next to help?

Rainer


Prof Brian Ripley wrote:
> Please try the attached.
> 
> Duncan: I fixed some other errors in configure.ac and src/Makevars.in, 
> and added a FIXME. If this works on MacOS X (and I am fairly confident 
> it will on FreeBSD since it now works on Solaris make), I can fix up the 
> FIXME too.
> 
> I was presuming the MacOS code came from Simon Urbanek, but I would have 
> expected him to know better than to use GNU make extensions.
> 
> Brian
> 
> On Tue, 20 Feb 2007, Prof Brian Ripley wrote:
> 
>> The problem is that rgl is apparently written for GNU make, and has 
>> (as shipped)
>>
>> ifdef MAKINGAGL
>> [EMAIL PROTECTED]@ -Iext
>> [EMAIL PROTECTED]@
>> else
>> PKG_CPPFLAGS= -If:/R/R-2.4.1/src/extra/zlib -DHAVE_PNG_H 
>> -If:/R/R-2.4.1/src/gnuwin32/bitmap/libpng  -Iext
>> PKG_LIBS=-lgdi32 -lopengl32 -lglu32 
>> -Lf:/R/R-2.4.1/src/gnuwin32/bitmap/libpng -
>> lpng -Lf:/R/R-2.4.1/src/extra/zlib -lz
>> endif
>>
>> and similar for BUILDAGL.
>>
>> That seems to have been written to make it workable on MacOS X. Given 
>> that configure knows (or could know) the OS, it seems better to write 
>> (via configure) a separate Makevars for MacOS X and remove all the 
>> ifdef...endif stuff for everyone else.  (If you do that in Makevars.in 
>> it should work.)
>>
>>
>> On Tue, 20 Feb 2007, Rainer Hurling wrote:
>>
>>> Duncan Murdoch schrieb:
>>>> On 2/20/2007 1:11 PM, Ranjan Maitra wrote:
>>>>> Hi Duncan,
>>>>> I don't know if this will list all the dependencies for your 
>>>>> documentation, since Rick's error messages did not involve 
>>>>> libraries and header files already installed by him for something 
>>>>> else, perhaps.
>>>>
>>>> No, but it's a start:  I'm thinking of something more like a FAQ than
>>>> comprehensive documentation.  Comprehensive docs are not feasible to
>>>> maintain (there are so many systems that Daniel and I don't use), but
>>>> hints that two non-standard packages solved one person's problems might
>>>> be enough of a hint to get someone else going.
>>>
>>> Duncan,
>>>
>>> thank you for this purpose. I am such a person who could need some help
>>> with installing rgl and hope it is ok to place it in this thread.
>>>
>>> My trial to install rgl_0.70.tar.gz on R-2.4.1 on FreeBSD 7.0-CURRENT
>>> ends up with errors. Obiously something is wrong with Makevars. I have
>>> no idea what to do next. 'rgl' is one of the rare cases that do not
>>> install under R on FreeBSD.
>>>
>>> The install messages are short:
>>>
>>> -
>>> #R CMD INSTALL rgl_0.70.tar.gz
>&

Re: [R] Installing Package rgl - Compilation Fails - FreeBSD

2007-02-20 Thread Rainer Hurling
Duncan Murdoch schrieb:
> On 2/20/2007 1:11 PM, Ranjan Maitra wrote:
>> Hi Duncan,
>> I don't know if this will list all the dependencies for your documentation, 
>> since Rick's error messages did not involve libraries and header files 
>> already installed by him for something else, perhaps.
> 
> No, but it's a start:  I'm thinking of something more like a FAQ than 
> comprehensive documentation.  Comprehensive docs are not feasible to 
> maintain (there are so many systems that Daniel and I don't use), but 
> hints that two non-standard packages solved one person's problems might 
> be enough of a hint to get someone else going.

Duncan,

thank you for this purpose. I am such a person who could need some help 
with installing rgl and hope it is ok to place it in this thread.

My trial to install rgl_0.70.tar.gz on R-2.4.1 on FreeBSD 7.0-CURRENT 
ends up with errors. Obiously something is wrong with Makevars. I have 
no idea what to do next. 'rgl' is one of the rare cases that do not 
install under R on FreeBSD.

The install messages are short:

-
#R CMD INSTALL rgl_0.70.tar.gz
* Installing to library '/usr/local/lib/R/library'
* Installing *source* package 'rgl' ...
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
configure: creating ./config.status
config.status: creating src/Makevars
** libs
"Makevars", line 9: Need an operator
"Makevars", line 12: Need an operator
"Makevars", line 15: Need an operator
"Makevars", line 21: Need an operator
"Makevars", line 23: Need an operator
"Makevars", line 36: Need an operator
"Makevars", line 38: Need an operator
make: fatal errors encountered -- cannot continue
chmod: /usr/local/lib/R/library/rgl/libs/*: No such file or directory
ERROR: compilation failed for package 'rgl'
** Removing '/usr/local/lib/R/library/rgl'
-

Are there any experiences with installing rgl on FreeBSD? Do you know if 
it is at all possible to get rgl to work on FreeBSD? If I can do 
anything like testing or giving more information let me know.

I appreciate any help. Thank you in advance.

Rainer Hurling

__
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] package 'rimage' install error on FreeBSD

2007-01-13 Thread Rainer Hurling
After not reaching the package maintainer ([EMAIL PROTECTED]) I 
hope someone on R-help@ can help.


I tried to install rimage_0.5-7.tar.gz under FreeBSD-7.0 CURRENT as root
with the following command:

R CMD INSTALL rimage_0.5-7.tar.gz

It stops with the following errors in the configure script:

[...snip...]
checking fftw.h usability... no
checking fftw.h presence... no
checking for fftw.h... no
[...snip...]

On my system this header file is located under

/usr/local/include/fftw.h

Different FreeBSD packages need different versions of fftw, so I have
three versions installed:

fftw-2.1.5_4
fftw3-3.1.2
fftw3-float-3.1.2

Is it possible that this is the reason for not finding the header?

The installation works well, when giving configure-args with the paths:

R CMD INSTALL --configure-args="--with-fftw-include=/usr/local/include/ 
--with-jpeg-include=/usr/local/include/" rimage_0.5-7.tar.gz

Anyone else having this problem on FreeBSD?


Many thanks in advance,

Rainer Hurling

__
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] alphachannel on pdf-device

2006-11-25 Thread Rainer Hurling
Thank you Paul Murrel for answering and thank you Brian Ripley for 
correcting this behaviour in R-patched.


I am sorry, but I think there is just another 'misfeature' with 
transparent figures since R-2.4.0 and it seems not to be corrected in 
todays R-2.4.0 Patched (2006-11-24 r39989).


In earlier versions when producing a transparent figure without any 
border (=NA), nothing was drawn. In newer versions there is something 
like a white border line. You can see it in particular when drawing a 
new dotted line above this border of the underlying figure. I should 
demonstrate it with a small example:



pdf("test_alpha.pdf", version="1.4")

plot(1:8, 1:8, type="n", xlab="", ylab="")

lines(c(1,8), c(1,8), type="l", col="lightblue", lwd=15)

# rectangle with alphachannel=255 (no transparency)
goldenrod1 <- rgb(255,193,37,255, names=c("goldenrod1"), max=255)
rect(4,4,7,7, col=goldenrod1, border=NA)
lines(c(4,4,7,7,4), c(4,7,7,4,4), col="red", lty=2)
text(5,7, "no transparency")

# polygon with alphachannel=64 (transparency near 40%)
polygon(c(5,2,2,5,5), c(2,2,5,5,2), col=rgb(255,192,203,64, max = 255), 
border=NA)

lines(c(5,2,2,5,5), c(2,2,5,5,2), col="red", lty=2)
text(4,2, "transparency 40%")

dev.off()
----

It is probably just a mistake. What do you think?

Rainer Hurling



Paul Murrell schrieb:

Hi

This appears to have been fixed in r-patched (by Brian Ripley)

Paul


Rainer Hurling wrote:

Dear R users,

since R-2.4.0 I am not able any more to draw figures without 
transparency after drawing one figure with alphachannel set lower than 100%.


For better unterstanding here a small example of my problem:


---
pdf(paste("test_alpha_rgb.pdf",sep=""), version="1.4")

plot(1:8, 1:8, type="n", xlab="", ylab="")

lines(c(1,8), c(1,8), type="l", col="lightblue", lwd=15)

# polygon with alphachannel=64 (transparency 40%)
polygon(c(5,2,2,5,5), c(2,2,5,5,2), col=rgb(255,192,203,64, max = 255), 
border=NA)

text(4,2, "transparency 40%")

# rectangle with alphachannel=255 (no transparency)
goldenrod1 <- rgb(255,193,37,255, names=c("goldenrod1"), max=255)
rect(4,4,7,7, col=goldenrod1, border=goldenrod1)
text(5,7, "no transparency")

dev.off()
---


In this example (see pdf in attachment) after plotting a line without 
any transparency a polygon is drawn with alphachannel set to 40%. All 
following figures and even text is shown with transparency.


The described behaviour seems to be the same on FreeBSD 7.0-CURRENT and 
on WindowsXP.


Am I doing something wrong?

Many thanks for any help,
Rainer Hurling


pdf("test_alpha.pdf", version="1.4")

plot(1:8, 1:8, type="n", xlab="", ylab="")

lines(c(1,8), c(1,8), type="l", col="lightblue", lwd=15)

# rectangle with alphachannel=255 (no transparency)
goldenrod1 <- rgb(255,193,37,255, names=c("goldenrod1"), max=255)
rect(4,4,7,7, col=goldenrod1, border=NA)
lines(c(4,4,7,7,4), c(4,7,7,4,4), col="red", lty=2)
text(5,7, "no transparency")

# polygon with alphachannel=64 (transparency near 40%)
polygon(c(5,2,2,5,5), c(2,2,5,5,2), col=rgb(255,192,203,64, max = 255), 
border=NA)
lines(c(5,2,2,5,5), c(2,2,5,5,2), col="red", lty=2)
text(4,2, "transparency 40%")

#for (x in 1:8) 
#  for (y in 1:8) 
#rect(x-0.5,y-0.5, x+0.5, y+0.5, col=rgb(255,193,37, 255/(x*y), max=255))

#rect(5,5,7,7, col=rgb(255,0,0, 255, max=255), border=NA)

dev.off()
__
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] alphachannel on pdf-device

2006-11-14 Thread Rainer Hurling

Dear R users,

since R-2.4.0 I am not able any more to draw figures without 
transparency after drawing one figure with alphachannel set lower than 100%.


For better unterstanding here a small example of my problem:


---
pdf(paste("test_alpha_rgb.pdf",sep=""), version="1.4")

plot(1:8, 1:8, type="n", xlab="", ylab="")

lines(c(1,8), c(1,8), type="l", col="lightblue", lwd=15)

# polygon with alphachannel=64 (transparency 40%)
polygon(c(5,2,2,5,5), c(2,2,5,5,2), col=rgb(255,192,203,64, max = 255), 
border=NA)

text(4,2, "transparency 40%")

# rectangle with alphachannel=255 (no transparency)
goldenrod1 <- rgb(255,193,37,255, names=c("goldenrod1"), max=255)
rect(4,4,7,7, col=goldenrod1, border=goldenrod1)
text(5,7, "no transparency")

dev.off()
---


In this example (see pdf in attachment) after plotting a line without 
any transparency a polygon is drawn with alphachannel set to 40%. All 
following figures and even text is shown with transparency.


The described behaviour seems to be the same on FreeBSD 7.0-CURRENT and 
on WindowsXP.


Am I doing something wrong?

Many thanks for any help,
Rainer Hurling



test_alpha_rgb.pdf
Description: Adobe PDF document
__
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] Unable to compile R-2.1.0

2005-06-07 Thread Rainer Hurling

Prof Brian Ripley wrote:
This has been reported to R-bugs twice already (and also on the lists): 
it seems autoconf and FreeBSD are making different assumptions.


If you look in today's R-devel archive you will see the requests for 
information I set on the second report.


It seems no one using FreeBSD ever tested the alphas or betas of R 2.1.0.


In the last years there were no serious problems with R on FreeBSD. So 
most of us FreeBSD users never had to test alphas and betas :-)


But you are right, we should test them from now on, thank you for this 
advice.



On Mon, 6 Jun 2005 [EMAIL PROTECTED] wrote:

I downloaded the latest R-2.1.0 tarball from cran (the one of 18/4/05) to
compile it under FreeBSD. Take into account that I compiled R-2.0.1 in 
the
same machine and OS like a charme, flawlessly and at the very fiirst 
shot.


Now with R-2.1.0, ./configure doesn't seem to say anything alarming but
make stops. Here an extract of both ./configure and make:

# ./configure
..
R is now configured for i386-unknown-freebsd5.4

 Source directory:  .
 Installation directory:/usr/local

 C compiler:gcc -D__NO_MATH_INLINES -g -O2
 C++ compiler:  g++  -g -O2
 Fortran compiler:  f77  -g -O2

 Interfaces supported:  X11, tcltk
 External libraries:readline, BLAS(ATLAS)
 Additional capabilities:   PNG, JPEG, iconv, MBCS, NLS
 Options enabled:   R profiling

 Recommended packages:  yes

configure: WARNING: you cannot build info or html versions of the R 
manuals


The last problem, reported by the configure script, has a solution:
To build the html and info versions of the R manuals you need at least 
Makeinfo 4.7. In FreeBSD6-CURRENT there had been an update a few days 
ago from Makeinfo 4.6 to 4.8. For other versions of FreeBSD (including 
5.4) you can install a new version via the ports system (print/texinfo).



--
Dr. Rainer Hurling   Phone: (049) 551 69401-145
Abteilung Waldschutz, Sachgebiet InsektenFax:   (049) 551 69401-160
Niedersächsische Forstliche Versuchsanstalt  Mobil: (049) 160 5835-143
Grätzelstraße 2, D-37079 Göttingen, GERMANY  [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


[R] R-2.1.0 doesn't compile on FreeBSD6-CURRENT

2005-04-23 Thread Rainer Hurling
Dear R-users,

is there anyone else with problems to get R-2.1.0 compiled on
FreeBSD6-CURRENT?

After typing '.configure' and then 'make' I get the following output:

-
[...snip...]
gcc -export-dynamic -L/usr/local/lib -o R.bin  Rmain.o  CConverters.o
CommandLineArgs.o Rdynload.o Renviron.o RNG.o apply.o arithmetic.o
apse.o array.o attrib.o base.o bind.o builtin.o character.o coerce.o
colors.o complex.o connections.o context.o cov.o cum.o dcf.o datetime.o
debug.o deparse.o deriv.o dotcode.o dounzip.o dstruct.o duplicate.o
engine.o envir.o errors.o eval.o format.o fourier.o gevents.o gram.o
gram-ex.o graphics.o identical.o internet.o iosupport.o lapack.o list.o
logic.o main.o mapply.o match.o memory.o model.o names.o objects.o
optim.o optimize.o options.o par.o paste.o pcre.o platform.o plot.o
plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o
qsort.o random.o regex.o registration.o relop.o saveload.o scan.o seq.o
serialize.o size.o sort.o source.o split.o sprintf.o startup.o
subassign.o subscript.o subset.o summary.o sysutils.o unique.o util.o
version.o vfonts.o xxxpr.o ../unix/libunix.a ../appl/libappl.a
../nmath/libnmath.a   -lg2c -lm  ../extra/zlib/libz.a
../extra/bzip2/libbz2.a ../extra/pcre/libpcre.a
/usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib -lreadline -lm
-liconv

errors.o(.text+0x154b): In function `do_gettext':
/usr/local/R-2.1.0/src/main/errors.c:779: undefined reference to
`__builtin_alloca'
errors.o(.text+0x15fa):/usr/local/R-2.1.0/src/main/errors.c:752:
undefined reference to `__builtin_alloca'
errors.o(.text+0x1652):/usr/local/R-2.1.0/src/main/errors.c:760:
undefined reference to `__builtin_alloca'
errors.o(.text+0x16aa):/usr/local/R-2.1.0/src/main/errors.c:770:
undefined reference to `__builtin_alloca'
errors.o(.text+0x1728):/usr/local/R-2.1.0/src/main/errors.c:738:
undefined reference to `__builtin_alloca'
errors.o(.text+0x274d):/usr/local/R-2.1.0/src/main/errors.c:829: more
undefined references to `__builtin_alloca' follow
*** Error code 1

Stop in /usr/local/R-2.1.0/src/main.
*** Error code 1

Stop in /usr/local/R-2.1.0/src/main.
*** Error code 1

Stop in /usr/local/R-2.1.0/src.
*** Error code 1

Stop in /usr/local/R-2.1.0.
-

Are there any experiences with this break?

R-2.0.1 _does_ compile on the same system.

Many thanks in advance,
Rainer Hurling

__
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