[Rd] Error when making R in Windows

2014-01-18 Thread 赵自强
Hi all,

 I¡¯m trying to build R (32-bit) under Windows 7 (64-bit).

 To do so, I just use ¡±make all recommended¡± as mentioned in the
documents and it does work for R 2.15.2.

 However, for R 3.0.2, I get the following error message,

   gcc -shared -s -static-libgcc -o tools.dll tmp.def text.o
init.o Rmd5.o md5.o signals.o install.o getfmts.o http.o gramLatex.o gramRd.
o ../../../gnuwin32/dllversion.o -L../.././../bin/i386 -lR

Error in parse(n = -1, file = file, srcfile = NULL, keep.source = FALSE) :

  invalid multibyte character in parser at line 32021

Error: unable to load R code in package 'tools'

Execution halted

make[2]: *** [all] Error 1

make[1]: *** [R] Error 1

make: *** [all] Error 2

 It seems that I get stuck in building the package ¡®tools¡¯.

Shall I just replace the codes for ¡®tools¡¯ with those from R 2.15.2?

 Thanks for your help.

Ziqiang Zhao

2014-01-18

 

 


[[alternative HTML version deleted]]

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


Re: [Rd] Error when making R in Windows

2014-01-18 Thread Prof Brian Ripley
The issue is that your version of Windows is not properly changing to a 
C locale.  The solution is to start the build in an 8-bit (preferably C) 
locale.


This is documented in R-patched at least: see the posting guide (which 
asked you to try R-patched before posting) and 
http://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Building-from-source


BTW: your email is not encoded correctly, so it may be that you have 
more pervasive locale breakages on your system.



On 18/01/2014 08:01, 赵自强 wrote:

Hi all,

  I¡¯m trying to build R (32-bit) under Windows 7 (64-bit).

  To do so, I just use ¡±make all recommended¡± as mentioned in the
documents and it does work for R 2.15.2.

  However, for R 3.0.2, I get the following error message,

gcc -shared -s -static-libgcc -o tools.dll tmp.def text.o
init.o Rmd5.o md5.o signals.o install.o getfmts.o http.o gramLatex.o gramRd.
o ../../../gnuwin32/dllversion.o -L../.././../bin/i386 -lR

Error in parse(n = -1, file = file, srcfile = NULL, keep.source = FALSE) :

   invalid multibyte character in parser at line 32021

Error: unable to load R code in package 'tools'

Execution halted

make[2]: *** [all] Error 1

make[1]: *** [R] Error 1

make: *** [all] Error 2

  It seems that I get stuck in building the package ¡®tools¡¯.

Shall I just replace the codes for ¡®tools¡¯ with those from R 2.15.2?

  Thanks for your help.

Ziqiang Zhao

2014-01-18






[[alternative HTML version deleted]]



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




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


[Rd] Using unit-tests as examples

2014-01-18 Thread Alexey Sergushichev
Hi,

Which is the best way to use unit tests as examples for documentation?
I use testthat, but if there is a good way to do this, for example,
only with RUnit, it'd still be good to know.

Unit-tests are usually simple and concise, so they are good candidates
for example code, but I don't want to copy them into documentation and
maintain by hands. I tried to google how people handle this, but
didn't find anything.

---
Best regards,
Alexey

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


[Rd] My first package

2014-01-18 Thread Axel Urbiz
Hi All,


I'm planning to submit my first package to R, and although I read all the
documentation, I'm not very clear on the following 2 items, from which I'd
appreciate your guidance:


1)I understand it is suggested to use the R dev version to build the
package. Which one specifically should I use to build a package on a Mac
OS? How about package dependencies, which version should I install on the R
dev version (and where should I get them)?


2) Not sure if this one belongs to this list. Does licensing follow the
logic of "inheritance" (i.e. if all the package dependencies of my package
are "GPL-2 | GPL-3", does my package need to use the same license agreement?



Thanks!

Axel.

[[alternative HTML version deleted]]

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


Re: [Rd] My first package

2014-01-18 Thread Simon Urbanek

On Jan 18, 2014, at 9:31 AM, Axel Urbiz  wrote:

> Hi All,
> 
> 
> I'm planning to submit my first package to R, and although I read all the
> documentation, I'm not very clear on the following 2 items, from which I'd
> appreciate your guidance:
> 
> 
> 1)I understand it is suggested to use the R dev version to build the
> package. Which one specifically should I use to build a package on a Mac
> OS? How about package dependencies, which version should I install on the R
> dev version (and where should I get them)?
> 

You can get latest R-devel builds for Mac OS X from

http://r.research.att.com

and the same is true for binary packages for R-devel - simply use 
http://r.research.att.com as the repository (in fact most CRAN mirrors should 
work as well).

Cheers,
Simon


> 2) Not sure if this one belongs to this list. Does licensing follow the
> logic of "inheritance" (i.e. if all the package dependencies of my package
> are "GPL-2 | GPL-3", does my package need to use the same license agreement?
> 
> 
> 
> Thanks!
> 
> Axel.
> 
>   [[alternative HTML version deleted]]
> 
> __
> 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] [R-SIG-Mac] My first package

2014-01-18 Thread Prof Brian Ripley

On 18/01/2014 15:25, Simon Urbanek wrote:


On Jan 18, 2014, at 9:31 AM, Axel Urbiz  wrote:


Hi All,


I'm planning to submit my first package to R, and although I read all the


To CRAN, not 'to R', I guess.


documentation, I'm not very clear on the following 2 items, from which I'd
appreciate your guidance:


1)I understand it is suggested to use the R dev version to build the


'R-devel', not 'R dev': see the R FAQ.


package. Which one specifically should I use to build a package on a Mac
OS? How about package dependencies, which version should I install on the R
dev version (and where should I get them)?



You can get latest R-devel builds for Mac OS X from

http://r.research.att.com

and the same is true for binary packages for R-devel - simply use 
http://r.research.att.com as the repository (in fact most CRAN mirrors should 
work as well).
Cheers,
Simon



2) Not sure if this one belongs to this list. Does licensing follow the
logic of "inheritance" (i.e. if all the package dependencies of my package
are "GPL-2 | GPL-3", does my package need to use the same license agreement?


No, but it needs to use a *compatible* one.  As the default use one 
package makes of another is fairly 'hands off', this mainly means that 
you cannot require dependencies whose usage conditions contradict those 
of your package.  For one specific CRAN interpretation of this, see its 
policies.


[Dependencies involving closer connections such as some of those 
implemented via LinkingTo may impose more stringent compatibility tests.]



--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


Re: [Rd] Using unit-tests as examples

2014-01-18 Thread Hadley Wickham
If you're using roxygen2, you can use @example tag to include an
external file into the examples.

Hadley

On Sat, Jan 18, 2014 at 7:18 AM, Alexey Sergushichev
 wrote:
> Hi,
>
> Which is the best way to use unit tests as examples for documentation?
> I use testthat, but if there is a good way to do this, for example,
> only with RUnit, it'd still be good to know.
>
> Unit-tests are usually simple and concise, so they are good candidates
> for example code, but I don't want to copy them into documentation and
> maintain by hands. I tried to google how people handle this, but
> didn't find anything.
>
> ---
> Best regards,
> Alexey
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
http://had.co.nz/

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


Re: [Rd] rexp, different results on 32/64 bit

2014-01-18 Thread Prof Brian Ripley

On 17/01/2014 18:58, Gábor Csárdi wrote:

Hi all,

I just run into this today. Apparently rexp() sometimes gives different
slightly results for the same seed on 32 bit and 64 bit machines. runif()
is the same for both, so the problem seems to be in rexp().


Rather, the 'problem' is in your expectations: different builds of R 
should be expected to give different results.


A better way to look at the fine detail of doubles is

> sprintf("%a", foo) # 64-bit
[1] "0x1.1f5a6e68a593p-2"
> sprintf("%a", foo) # 32-bit
[1] "0x1.1f5a6e68a5931p-2"

on my Fedora box.  (Otherwise the difference might well have been in the 
binary to decimal conversion used for printing.)


And for the record: the reasons 32-bit results are often different
include that the lowest common denominator for i686 cpus[*] is lower
than for x86_64 ones. Also, the OS X results quoted most likely are for
the CRAN distribution using a rather old compiler which does not
optimize as well as current ones, and you are comparing different
runtimes (libc), whereas I was comparing i686 and x86_64 compiles on the
same machine, with the same compiler/runtime versions.

[*] And for R for Windows i386 cpus are still supported, alongside 
Windows XP.




64 bit Linux is the same as 64 bit OSX, and R-devel gives the same results
as R-3.0.2.

Best,
Gabor

# -

options(digits=22) ; set.seed(9) ; rexp(1, 5)

[1] 0.2806184054728815824298

options(digits=22) ; set.seed(9) ; runif(1)

[1] 0.2216013972647488117218

sessionInfo()

R version 3.0.2 (2013-09-25)
Platform: i686-pc-linux-gnu (32-bit)

locale:
  [1] LC_CTYPE=en_US.utf8   LC_NUMERIC=C
  [3] LC_TIME=en_US.utf8LC_COLLATE=en_US.utf8
  [5] LC_MONETARY=en_US.utf8LC_MESSAGES=en_US.utf8
  [7] LC_PAPER=en_US.utf8   LC_NAME=C
  [9] LC_ADDRESS=C  LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C

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

# -

options(digits=22) ; set.seed(9) ; rexp(1, 5)

[1] 0.2806184054728815269186

options(digits=22) ; set.seed(9) ; runif(1)

[1] 0.2216013972647488117218

sessionInfo()

R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

[[alternative HTML version deleted]]

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




--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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