Re: [Rd] include dll in R-package

2012-08-28 Thread Berend Hasselman

On 28-08-2012, at 01:29, LIYING HUANG wrote:

> 
> I am quite new in R, I looked at R manual- how to build R Package, 
> still not very clear. Yes, it would be very helpful if I could 
> download a package having Fortran source codes to look at, Do 
> you know any package built with Fortran source code? Thanks!
> 

To mention a few:

deSolve
minpack.lm
nleqslv
rootSolve
xts

and probably many more.

Berend

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


Re: [Rd] parLapply fails to detect default cluster?

2012-08-28 Thread Martin Morgan
Thank you for the fix, in svn R-devel and 2-15-patched r60447, r60448. 
Martin


On 08/21/2012 06:50 AM, Martin Morgan wrote:

invoking parLapply without a cluster fails to find a previously
registered cluster

 > library(parallel)
 > setDefaultCluster(makePSOCKcluster(2))
 > parLapply(X=1:2, fun=function(...) {})
Error in cut.default(i, breaks) : invalid number of intervals

This is because in parLapply length(cl) is determined before
defaultCluster(cl) is called. By inspection, this appears to be true of
other high-level functions, but ironically not of parApply.

In defaultCluster, t would also be helpful to check that the detected
cluster, user-supplied or other, is a valid cluster.

diff attached.

Martin


__
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: Arnold Building M1 B861
Phone: (206) 667-2793

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


[Rd] Don't dput() data frames?

2012-08-28 Thread R. Michael Weylandt
/src/main/attrib.c contains this comment in row_names_gets():

  /* This should not happen, but if a careless user dput()s a
   data frame and sources the result, it will */

which svn blame says Prof Ripley placed there in r39830 with the
commit message "correct the work of dput() on the row names of a data
frame with compact representation."

Is there a problem / better way to use the result of a hefty dput than
source()ing it? This seems to work rather robustly:

data(iris)
source(textConnection(paste0("iris2 <- ", capture.output(dput(iris)
identical(iris, iris2)

Cheers,
Michael

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


Re: [Rd] Don't dput() data frames?

2012-08-28 Thread Simon Urbanek

On Aug 28, 2012, at 1:51 PM, R. Michael Weylandt wrote:

> /src/main/attrib.c contains this comment in row_names_gets():
> 
>  /* This should not happen, but if a careless user dput()s a
>   data frame and sources the result, it will */
> 
> which svn blame says Prof Ripley placed there in r39830 with the
> commit message "correct the work of dput() on the row names of a data
> frame with compact representation."
> 
> Is there a problem / better way to use the result of a hefty dput than
> source()ing it?

It's pretty much the least efficient and most dangerous (as in insecure) way. 
That's why there is serialization instead ...

Cheers,
Simon



> This seems to work rather robustly:
> 
> data(iris)
> source(textConnection(paste0("iris2 <- ", capture.output(dput(iris)
> identical(iris, iris2)
> 
> Cheers,
> Michael
> 
> __
> 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] Don't dput() data frames?

2012-08-28 Thread R. Michael Weylandt
On Tue, Aug 28, 2012 at 1:00 PM, Simon Urbanek
 wrote:
>
> On Aug 28, 2012, at 1:51 PM, R. Michael Weylandt wrote:
>
>> /src/main/attrib.c contains this comment in row_names_gets():
>>
>>  /* This should not happen, but if a careless user dput()s a
>>   data frame and sources the result, it will */
>>
>> which svn blame says Prof Ripley placed there in r39830 with the
>> commit message "correct the work of dput() on the row names of a data
>> frame with compact representation."
>>
>> Is there a problem / better way to use the result of a hefty dput than
>> source()ing it?
>
> It's pretty much the least efficient and most dangerous (as in insecure) way. 
> That's why there is serialization instead ...
>

My most common use of dput() is for sending plain text data over
r-help; would this be an official/unofficial advisement to push folks
to use

serialize(x, NULL, ascii = TRUE)

instead? At first blush that seems to be less space efficient:

sum(nchar(capture.output(dput(iris # 3767

sum(nchar(serialize(iris, NULL, ascii = TRUE))) # 5922: probably even
more if we dump it properly to plain text in a copy+pasteable form

Michael

> Cheers,
> Simon
>
>
>
>> This seems to work rather robustly:
>>
>> data(iris)
>> source(textConnection(paste0("iris2 <- ", capture.output(dput(iris)
>> identical(iris, iris2)
>>
>> Cheers,
>> Michael
>>
>> __
>> 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] Don't dput() data frames?

2012-08-28 Thread Simon Urbanek

On Aug 28, 2012, at 2:14 PM, "R. Michael Weylandt"  
wrote:

> On Tue, Aug 28, 2012 at 1:00 PM, Simon Urbanek
>  wrote:
>> 
>> On Aug 28, 2012, at 1:51 PM, R. Michael Weylandt wrote:
>> 
>>> /src/main/attrib.c contains this comment in row_names_gets():
>>> 
>>> /* This should not happen, but if a careless user dput()s a
>>>  data frame and sources the result, it will */
>>> 
>>> which svn blame says Prof Ripley placed there in r39830 with the
>>> commit message "correct the work of dput() on the row names of a data
>>> frame with compact representation."
>>> 
>>> Is there a problem / better way to use the result of a hefty dput than
>>> source()ing it?
>> 
>> It's pretty much the least efficient and most dangerous (as in insecure) 
>> way. That's why there is serialization instead ...
>> 
> 
> My most common use of dput() is for sending plain text data over
> r-help; would this be an official/unofficial advisement to push folks
> to use
> 
> serialize(x, NULL, ascii = TRUE)
> 
> instead? At first blush that seems to be less space efficient:
> 
> sum(nchar(capture.output(dput(iris # 3767
> 
> sum(nchar(serialize(iris, NULL, ascii = TRUE))) # 5922: probably even
> more if we dump it properly to plain text in a copy+pasteable form
> 

No, if you want small, readable snippets you can certainly use dput(), but when 
you say data frame I don't imagine anything that can be sent by e-mail :). 
Obviously, for toy examples you don't care about performance ...

As for size efficiency:
> save(iris,file="iris.RData")
> file.info("iris.RData")$size
[1] 1100
so in base64 that would be about 1.5k - much less than any of the above.

Cheers,
Simon


> Michael
> 
>> Cheers,
>> Simon
>> 
>> 
>> 
>>> This seems to work rather robustly:
>>> 
>>> data(iris)
>>> source(textConnection(paste0("iris2 <- ", capture.output(dput(iris)
>>> identical(iris, iris2)
>>> 
>>> Cheers,
>>> Michael
>>> 
>>> __
>>> 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] Fwd: Re: Package cwhmisc and problems

2012-08-28 Thread Duncan Murdoch
I'd guess you have a syntax error in the dependencies listed in your 
DESCRIPTION file.  (It might be Depends, Suggests, or one of the others.)


Duncan Murdoch


On 12-08-24 6:20 AM, Christian Hoffmann wrote:




 Original-Nachricht 
Betreff:Re: Package cwhmisc and problems
Datum:  Fri, 24 Aug 2012 07:34:14 +0100
Von:Prof Brian Ripley 
An: Christian Hoffmann 
Kopie (CC): c...@r-project.org



This is the address for CRAN submissions.  Please ask for help on R-help
or R-devel.

On 23/08/2012 20:16, Christian Hoffmann wrote:

Hi,
I have revised my package cwhmisc and want to re-submit it. One big
stumbling stone is the 'sudden' appearance of

$ R CMD check /Users/hoffmann/R/cwhmisc
* using log directory ‘/Users/hoffmann/R/cwhmisc/R/cwhmisc.Rcheck’
* using R version 2.15.0 (2012-03-30)
* using platform: x86_64-apple-darwin9.8.0 (64-bit)
* using session charset: UTF-8
* checking for file ‘cwhmisc/DESCRIPTION’ ... OK
* this is package ‘cwhmisc’ version ‘3.1’
* checking package namespace information ... OK
* checking package dependencies ...Fehler in if (x2 != x1) { : Fehlender
Wert, wo TRUE/FALSE nötig ist
Ausführung angehalten

Grep-ing my source directory for '(x2 != x1)' does not find anything, so
I guess this is a message internal to R CMD check. Before doing a binary
search by moving out chunks of *.R and *.Rd files until the error
disappears, I beg to ask to give me a pointer to how to circumvent this
block. I can send you my whole source of *.R and *.Rd files if that can
be of any help.

Thanks for assisting me,

Christian Hoffmann






__
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