[Rd] make error for R 2.13.0

2010-10-17 Thread Tengfei Yin
Hi dear all

It's the first time for me to install a developmental version of R, I came
across following errors, my system is

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04.1 LTS"

I downloaded the dev version of R in cran R source, and downloaded the
recommended packages by using wget as described in R manual, and run

./tools/link-recommended

 ./configure runs successfully

make give me following errors


##

begin installing recommended package cluster

* installing *source* package ‘cluster’ ...

** libs

make[3]: Entering directory `/tmp/Rtmpgxd64f/R.INSTALL33128ce7/cluster/src'

gcc -std=gnu99 
-I/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/include
 -I/usr/local/include-fpic  -g -O2 -c clara.c -o clara.o

gfortran   -fpic  -g -O -c daisy.f -o daisy.o

gfortran   -fpic  -g -O -c dysta.f -o dysta.o

gcc -std=gnu99 
-I/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/include
 -I/usr/local/include-fpic  -g -O2 -c fanny.c -o fanny.o

gcc -std=gnu99 
-I/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/include
 -I/usr/local/include-fpic  -g -O2 -c init.c -o init.o

gfortran   -fpic  -g -O -c meet.f -o meet.o

gfortran   -fpic  -g -O -c mona.f -o mona.o

gcc -std=gnu99 
-I/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/include
 -I/usr/local/include-fpic  -g -O2 -c pam.c -o pam.o

gcc -std=gnu99 
-I/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/include
 -I/usr/local/include-fpic  -g -O2 -c sildist.c -o sildist.o

gcc -std=gnu99 
-I/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/include
 -I/usr/local/include-fpic  -g -O2 -c spannel.c -o spannel.o

gfortran   -fpic  -g -O -c twins.f -o twins.o

gcc -std=gnu99 -shared -L/usr/local/lib64 -o cluster.so clara.o
daisy.o dysta.o fanny.o init.o meet.o mona.o pam.o sildist.o spannel.o
twins.o -lgfortran -lm

make[3]: Leaving directory `/tmp/Rtmpgxd64f/R.INSTALL33128ce7/cluster/src'

installing to 
/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/library/cluster/libs

** R

Warning in parse(outFile) :

  invalid input found on input connection
'/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/library/cluster/R/cluster'

** data

**  moving datasets to lazyload DB

** inst

** preparing package for lazy loading

Warning in parse(n = -1, file = file) :

  invalid input found on input connection
'/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/library/cluster/R/cluster'

** help

Warning in readLines(file, warn = FALSE) :

  invalid input found on input connection
'/tmp/Rtmpgxd64f/R.INSTALL33128ce7/cluster/man/plantTraits.Rd'

Warning: /tmp/Rtmpgxd64f/R.INSTALL33128ce7/cluster/man/plantTraits.Rd:69:
unexpected END_OF_INPUT 'Structuration de communaut

'

*** installing help indices

** building package indices ...

** testing if installed package can be loaded

Warning: S3 methods ‘clusplot.default’, ‘clusplot.partition’,
‘pltree.twins’, ‘silhouette.default’, ‘silhouette.clara’,
‘silhouette.partition’, ‘plot.agnes’, ‘plot.diana’, ‘plot.mona’,
‘plot.partition’, ‘plot.silhouette’, ‘print.mona’, ‘print.pam’,
‘print.summary.mona’, ‘print.summary.pam’, ‘print.summary.silhouette’,
‘summary.mona’, ‘summary.pam’, ‘summary.silhouette’ were declared in
NAMESPACE but not found

Error in namespaceExport(ns, exports) :

  undefined exports: clusplot, pltree, silhouette, mona, pam,
bannerplot, lower.to.upper.tri.inds, upper.to.lower.tri.inds,
meanabsdev, sizeDiss, sortSilhouette

ERROR: loading failed

* removing 
‘/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/library/cluster’

make[2]: *** [cluster.ts] Error 1

make[2]: Leaving directory
`/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/src/library/Recommended'

make[1]: *** [recommended-packages] Error 2

make[1]: Leaving directory
`/home/tengfei/R/x86_64-pc-linux-gnu-library/2.13/R-devel/src/library/Recommended'

make: *** [stamp-recommended] Error 2


#

I don't know if I miss sth important or did anything wrong,  sorry to
bother you guys.


Tengfei




-- 
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274

[[alternative HTML version deleted]]

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


[Rd] Reference Class error message: may be caused by lazy evaluation?

2011-06-08 Thread Tengfei Yin
Dear All,

I came across an error message recently when constructing a reference class,
an example is attached below, it looks like only if I call a specific method
in advance, otherwise it cannot be found in defined method without using
.self, this make it difficulty that sometimes in my initialize method, I
need to call other method defined in the same reference class, the
workaround for this is add .sef to it.


###  example begin 
setRefClass("testclass", fields = list(a = "numeric"),
methods = list(
  addOne = function(){
a <<- a+1
print(a)
  },
  add = function(){
addOne()
  },
  show = function(){
print(addOne)
  },
  showself = function(){
print(.self$addOne)
  }
  ))

obj <- new("testclass", a = 1)
obj$show()  #
Error in print(addOne) : object 'addOne' not found
obj$addOne()   #
return 2, works
obj$show()  #
after calling addOne(), show() works

## works if use .self$...
obj2 <- new("testclass", a = 1)
obj2$showself()

## works when call the method directly within another method
obj3 <- new("testclass", a = 1)
obj3$add()

 end ##

I am still learning this new technique, if I made any mistake I didn't
notice before, please let me know, I will really appreciate that.

Thanks a lot!

Tengfei

-- 
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274
Homepage: www.tengfei.name

[[alternative HTML version deleted]]

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


Re: [Rd] Reference Class error message: may be caused by lazy evaluation?

2011-06-09 Thread Tengfei Yin
Hi John and Martin,

Thanks a lot for these elucidation and examples, that's very helpful for me
to understand the underlying mechanism. And also thanks for those
suggestions on programming style. I will keep that in mind~

cheers

Tengfei

On Thu, Jun 9, 2011 at 10:28 AM, Martin Morgan  wrote:

> On 06/09/2011 10:11 AM, John Chambers wrote:
>
>> Good catch.
>>
>> Here's the problem. To save space and time, reference methods are not
>> all copied to every object in the class. Instead, the methods are copied
>> in when first accessed. Methods are functions which use the object as
>> their environment. So that is the sense in which "lazy evaluation" is
>> involved.
>>
>> If a method calls another method (add() calling addOne() in your
>> example), then the method for the `$` operator knows to copy over that
>> method (addOne). (The second of my examples below shows this.) But if
>> the method _refers_ to another method without calling it, the code
>> analysis does not currently catch the reference.
>>
>> We can fix that, although it's a little subtle. Meanwhile, your
>> showself() is a good workaround.
>>
>> For anyone interested, the code below illustrates.
>>
>> One point of style. I would suggest saving the generator object and
>> calling its $new() method, as below, rather than treating the reference
>> class as an S4 class. The result is identical AFAIK, but the style is
>> more typical of such OOP languages.
>>
>
> I wonder if this is an opportunity to be more authoritarian? It seems to be
> a common temptation to call S4 new() and, for me, introduces a source of
> uncertainty / confusion when trying to understand why code does not work.
>
> Martin
>
>
>> John
>>
>> ---
>>  > tc <- setRefClass("testclass", fields = list(a = "numeric"),
>> + methods = list(
>> 
>> + ))
>>  > t1 <- tc$new(a=1)
>>  > ss = t1$show
>>  > ss
>> Class method definition for method show()
>> function ()
>> {
>> print(addOne)
>> }
>> 
>>  > ev = environment(ss)
>>  > ev
>> 
>>  > t1
>> An object of class "testclass"
>>  # <<<< same environment
>>  > objects(ev)
>> [1] "a" "show" #<<<< not addOne, though
>>  > t1$addOne
>> Class method definition for method addOne()
>> function ()
>> {
>> a <<- a + 1
>> print(a)
>> }
>> 
>>  > objects(ev)
>> [1] "a" "addOne" "show" # <<<< now addOne is there
>>
>>
>> On 6/8/11 4:38 PM, Tengfei Yin wrote:
>>
>>> Dear All,
>>>
>>> I came across an error message recently when constructing a reference
>>> class,
>>> an example is attached below, it looks like only if I call a specific
>>> method
>>> in advance, otherwise it cannot be found in defined method without using
>>> .self, this make it difficulty that sometimes in my initialize method, I
>>> need to call other method defined in the same reference class, the
>>> workaround for this is add .sef to it.
>>>
>>>
>>> ### example begin 
>>> setRefClass("testclass", fields = list(a = "numeric"),
>>> methods = list(
>>> addOne = function(){
>>> a<<- a+1
>>> print(a)
>>> },
>>> add = function(){
>>> addOne()
>>> },
>>> show = function(){
>>> print(addOne)
>>> },
>>> showself = function(){
>>> print(.self$addOne)
>>> }
>>> ))
>>>
>>> obj<- new("testclass", a = 1)
>>> obj$show() #
>>> Error in print(addOne) : object 'addOne' not found
>>> obj$addOne() #
>>> return 2, works
>>> obj$show() #
>>> after calling addOne(), show() works
>>>
>>> ## works if use .self$...
>>> obj2<- new("testclass", a = 1)
>>> obj2$showself()
>>>
>>> ## works when call the method directly within another method
>>> obj3<- new("testclass", a = 1)
>>> obj3$add()
>>>
>>>  end ##
>>>
>>> I am still learning this new technique, if I made any mistake I didn't
>>> notice before, please let me know, I will really appreciate that.
>>>
>>> Thanks a lot!
>>>
>>> Tengfei
>>>
>>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>
>
> --
> Computational Biology
> Fred Hutchinson Cancer Research Center
> 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
>
> Location: M1-B861
> Telephone: 206 667-2793
>



-- 
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274
Homepage: www.tengfei.name

[[alternative HTML version deleted]]

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


Re: [Rd] [R] semi-transparency not supported in devel R? "alpha" cannot be specified in qplot()

2012-01-22 Thread Tengfei Yin
Hi Prof.Brian Ripley and Yihui,

Thanks for the suggestions on the R-help list. and sorry for posting on the
wrong list.

For Yihui's question, I double checked, I already have the dependencies you
mentioned in the email and also other comprehensive list of ubuntu packages
required for building R, with courtesy of Hervé Pagès mentioned in other
mailing list.

For Prof. Brian Ripley's suggestion:

for R 2.14, after qplot, dev.cur() return X11cairo, but in R-svn, it
returns just X11.

I do forget to use --with-cairo when configure it, but then  I tied

./configure --enable-R-shlib  --with-cairo --with-libpng --with-jpeglib
 --enable-memory-profiling

I got following message
...
R is now configured for x86_64-unknown-linux-gnu

  Source directory:  .
  Installation directory:/usr/local

  C compiler:gcc -std=gnu99  -g -O2
  Fortran 77 compiler:   gfortran  -g -O2

  C++ compiler:  g++  -g -O2
  Fortran 90/95 compiler:gfortran -g -O2
  Obj-C compiler:

  Interfaces supported:  X11, tcltk
  External libraries:readline
  Additional capabilities:   PNG, JPEG, NLS, cairo
  Options enabled:   shared R library, shared BLAS, R profiling,
memory profiling, Java

  Recommended packages:  yes


after normal make and sudo make install, then in R, when I try to use alpha
in qplot, I still got the same warning, and dev.cur() still return X11.

Thanks and happy Chinese new year.

Tengfei



On Sun, Jan 22, 2012 at 5:42 AM, Yihui Xie  wrote:

> When you build R by yourself, you need to make sure all its
> dependencies are installed; I usually use this in Ubuntu:
>
> sudo apt-get build-dep r-base-dev
>
> As Prof Ripley said, your problem is likely to be a missing cairo
> package in your system (something like libcairo2-dev, I guess).
>
> Regards,
> Yihui
> --
> Yihui Xie 
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
>
>
>
> On Sat, Jan 21, 2012 at 4:39 PM, Tengfei Yin  wrote:
> > Hi dear all,
> >
> > In my laptop(ubuntu 11.10 64bit), I maintained a released R (2.14) and a
> > developmental R, I can specify qplot(..., alpha = ) in R 2.14 , but when
> I
> > try to use transparency in developmental R, I got a warning message and
> the
> > plot is clearly not I want.
> >
> > minimal example:
> >> qplot(data = mtcars, x = mpg, y = cyl, alpha = cyl)
> > Warning message:
> > In grid.Call.graphics(L_points, x$x, x$y, x$pch, x$size) :
> >  semi-transparency is not supported on this device: reported only once
> per
> > page
> >> sessionInfo()
> > R Under development (unstable) (2012-01-21 r58156)
> > Platform: x86_64-unknown-linux-gnu (64-bit)
> >
> > locale:
> >  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
> >  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
> >  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
> >  [7] LC_PAPER=C LC_NAME=C
> >  [9] LC_ADDRESS=C   LC_TELEPHONE=C
> > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
> >
> > attached base packages:
> > [1] grid  stats graphics  grDevices utils datasets  methods
> > [8] base
> >
> > other attached packages:
> > [1] ggplot2_0.8.9 proto_0.3-9.2 reshape_0.8.4 plyr_1.7.1
> >
> > loaded via a namespace (and not attached):
> > [1] digest_0.5.1
> >
> >
> > I have no idea what happened here, because if I miss some important
> system
> > dependencies, why it's still working in R 2.14?
> >
> > Any suggestions or possible solution will be really appreciated. Thanks
> >
> > Tengfei
> >
> > --
> > Tengfei Yin
> > MCDB PhD student
> > 1620 Howe Hall, 2274,
> > Iowa State University
> > Ames, IA,50011-2274
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > r-h...@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.
>



-- 
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274
Homepage: www.tengfei.name

[[alternative HTML version deleted]]

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


Re: [Rd] [R] semi-transparency not supported in devel R? "alpha" cannot be specified in qplot()

2012-02-19 Thread Tengfei Yin
Hi

A little following up for this issue for google searchers. libcairo2-dev is
not the problem, but as yihui suggested

sudo apt-get build-dep r-base-dev

did the trick for me, sorry that I didn't see the reply carefully enough, I
miss the "build-dep" part and thought it was "install"...
anyway, I still have no idea why without running this command, R 2.14 works
fine while R-dev from svn(compiling from source) didn't 

Thanks a lot for all the suggestions!

Tengfei



On Sun, Jan 22, 2012 at 4:40 PM, Tengfei Yin  wrote:

> Hi Prof.Brian Ripley and Yihui,
>
> Thanks for the suggestions on the R-help list. and sorry for posting on
> the wrong list.
>
> For Yihui's question, I double checked, I already have the dependencies
> you mentioned in the email and also other comprehensive list of ubuntu 
> packages
> required for building R, with courtesy of Hervé Pagès mentioned in other
> mailing list.
>
> For Prof. Brian Ripley's suggestion:
>
> for R 2.14, after qplot, dev.cur() return X11cairo, but in R-svn, it
> returns just X11.
>
> I do forget to use --with-cairo when configure it, but then  I tied
>
> ./configure --enable-R-shlib  --with-cairo --with-libpng --with-jpeglib
>  --enable-memory-profiling
>
> I got following message
> ...
> R is now configured for x86_64-unknown-linux-gnu
>
>   Source directory:  .
>   Installation directory:/usr/local
>
>   C compiler:gcc -std=gnu99  -g -O2
>   Fortran 77 compiler:   gfortran  -g -O2
>
>   C++ compiler:  g++  -g -O2
>   Fortran 90/95 compiler:gfortran -g -O2
>   Obj-C compiler:
>
>   Interfaces supported:  X11, tcltk
>   External libraries:readline
>   Additional capabilities:   PNG, JPEG, NLS, cairo
>   Options enabled:   shared R library, shared BLAS, R profiling,
> memory profiling, Java
>
>   Recommended packages:  yes
>
>
> after normal make and sudo make install, then in R, when I try to use
> alpha in qplot, I still got the same warning, and dev.cur() still return
> X11.
>
> Thanks and happy Chinese new year.
>
> Tengfei
>
>
>
> On Sun, Jan 22, 2012 at 5:42 AM, Yihui Xie  wrote:
>
>> When you build R by yourself, you need to make sure all its
>> dependencies are installed; I usually use this in Ubuntu:
>>
>> sudo apt-get build-dep r-base-dev
>>
>> As Prof Ripley said, your problem is likely to be a missing cairo
>> package in your system (something like libcairo2-dev, I guess).
>>
>> Regards,
>> Yihui
>> --
>> Yihui Xie 
>> Phone: 515-294-2465 Web: http://yihui.name
>> Department of Statistics, Iowa State University
>> 2215 Snedecor Hall, Ames, IA
>>
>>
>>
>> On Sat, Jan 21, 2012 at 4:39 PM, Tengfei Yin 
>> wrote:
>> > Hi dear all,
>> >
>> > In my laptop(ubuntu 11.10 64bit), I maintained a released R (2.14) and a
>> > developmental R, I can specify qplot(..., alpha = ) in R 2.14 , but
>> when I
>> > try to use transparency in developmental R, I got a warning message and
>> the
>> > plot is clearly not I want.
>> >
>> > minimal example:
>> >> qplot(data = mtcars, x = mpg, y = cyl, alpha = cyl)
>> > Warning message:
>> > In grid.Call.graphics(L_points, x$x, x$y, x$pch, x$size) :
>> >  semi-transparency is not supported on this device: reported only once
>> per
>> > page
>> >> sessionInfo()
>> > R Under development (unstable) (2012-01-21 r58156)
>> > Platform: x86_64-unknown-linux-gnu (64-bit)
>> >
>> > locale:
>> >  [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
>> >  [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
>> >  [5] LC_MONETARY=en_US.UTF-8LC_MESSAGES=en_US.UTF-8
>> >  [7] LC_PAPER=C LC_NAME=C
>> >  [9] LC_ADDRESS=C   LC_TELEPHONE=C
>> > [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>> >
>> > attached base packages:
>> > [1] grid  stats graphics  grDevices utils datasets  methods
>> > [8] base
>> >
>> > other attached packages:
>> > [1] ggplot2_0.8.9 proto_0.3-9.2 reshape_0.8.4 plyr_1.7.1
>> >
>> > loaded via a namespace (and not attached):
>> > [1] digest_0.5.1
>> >
>> >
>> > I have no idea what happened here, because if I miss some important
>> system
>> > dependencies, why it's still working in R 2.14?
>> >
>> > Any suggestions or possible solution will be really appreciated. Thanks
>> >
>>