Re: [Rd] BitSet equivalent? Java code usable?

2011-10-12 Thread Joachim Harloff
> If you don't have NAs in your bits, you might be able to use the raw
> vector type. A raw value is one byte (8 bits), doesn't support NAs and
> supports bit operations on all the bits at once:
> 
>   &, |, !, xor
> 
> You'd probably want to wrap it into a class that allows a more
> BitSet-like view of it though. Maybe there's a package out there that
> does that already?
> 
> and if you DO have NAs, you could use two raw vectors (or two
> consecutive raw-vector bits per BitSet bit).
> 
> Good luck!
> 
> /Tommy
> 
Hi Tommy and Uwe,

thank you. I thought about similar things. Moreover, there are dynamic size 
equivalents for BitSets available for C++ (e.g. from Boost. It should be 
possible to create similar code on one's own)(unfortunately I am ignorant about 
Assembler programming) and these could build the basis for a new type in R.
Yes, a two bit value still was fourfold efficient in memory usage than a byte. 
This would probably pay off more than fourfold in terms of CPU time due to much 
less cache related activity. But was it also more efficient in the number of 
processing steps involved? As you wrote it required creating a new class where 
each &, |, !, xor operation needs a redefinition involving (at least) one 
additional bitmask operation.
To answer this question I'd need more knowledge about the basics of R's basic 
types and memory allocation. Are they compiled in C? Fortran? Using the GNU 
compiler? How could I serialize? Sorry, I never cared about that. Maybe there 
is a good resource about it on the R web site.
Even more computation steps in terms of a choice between different bitmasks 
will arise from the question: What do we do about NAs? 
NA + 0 -> NA or NA + 0 -> 0 ?
NA + NA -> NA or NA + NA -> 0?
Does one NA in one bit field influence the values of other bit fields of the 
same BitSet(s)?
And so on. The truth table is going to have many interesting variants besides 
the obvious solution. 
What does this mean for the efficiency gains expected? Do they vanish?

Well at least now I know which questions to tackle next. Thank you. - It's just 
a hobby and will take considerable time to hatch.

Joachim

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


Re: [Rd] R CMD INSTALL configure.args and CC customization

2011-10-12 Thread George Ostrouchov
One way to deal with this is to install R itself with mpicc. Then all 
packages are installed with mpicc and get the required MPI libraries and 
includes by default. I have done this with R-2.13.0 on an Opteron 
cluster running CentOS-5 a while ago and so far it has worked out great.

I crosspost to r-sig-hpc and welcome others to comment if there are 
potential downsides to this solution.

George


> Michael Spiegel michael.m.spiegel at gmail.com 
> 
> /Fri Sep 9 20:40:42 CEST 2011/ 
> I am running into the following issue that has been previously
> reported on the R-devel mailing list. The short version is that I'm
> writing a package for MPI, and I'd like to change CC and SHLIB_LD to
> "mpicc". Trying to change them in Makevars.in has no effect, because
> the values are clobbered by /etc/R/Makeconf. Will the following
> changes to Makeconf.in introduce any problems?
>
> --Michael

-- 
George Ostrouchov
Statistics and Data Sciences Group
Computer Science and Mathematics Division
Oak Ridge National Laboratory
(865) 574-3137  http://www.csm.ornl.gov/~ost


[[alternative HTML version deleted]]

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


[Rd] gettext domain and namespaces

2011-10-12 Thread Milan Bouchet-Valat
Hi!

I thought having a NAMESPACE file in an R package was enough to pass the
correct 'domain' argument to gettext(), but it can't get this to work
with a Rcommander plugin I'm developing[1]. Is that a know bug? Or is
this related to the fact that Rcmdr does some black magic when loading
plugins?

I know my PO files are correctly named since Rcmdr is able to show
translated strings in the menus it loads from my package (using domain
R-$PACKAGE). What can I to to debug this further?

Thanks for your help.


1: https://r-forge.r-project.org/projects/rcmdr-tms/

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


Re: [Rd] [R-sig-hpc] R CMD INSTALL configure.args and CC customization

2011-10-12 Thread Michael Spiegel
Thanks! This is a possible solution, but I would argue not a preferable 
solution. I'd advocate a mechanism that provides transparent support for MPI, 
analogous to the way that R 2.13.0 and upwards provides transparent support for 
OpenMP. Expressing a personal opinion, I would stress the importance of 
providing both shared memory and message parallel parallelism out-of-the-box in 
the R interpreter. To use OpenMP or MPI the user would need to have runtime 
libraries pre-installed on their system. This patch would make it easier for a 
library to auto-detect an MPI implementation, assuming mpicc is in the path.

My initial post on r-devel had a bug, sorry about that. I've posted a new patch 
on r-sig-hpc that behaves as intended. It is available here: 
https://stat.ethz.ch/pipermail/r-sig-hpc/2011-September/001104.html.

-Original Message-
From: r-sig-hpc-boun...@r-project.org [mailto:r-sig-hpc-boun...@r-project.org] 
On Behalf Of George Ostrouchov
Sent: Tuesday, October 11, 2011 9:59 AM
To: michael.m.spieg...@gmail.com
Cc: r-sig-...@r-project.org; r-devel@r-project.org
Subject: Re: [R-sig-hpc] R CMD INSTALL configure.args and CC customization

One way to deal with this is to install R itself with mpicc. Then all packages 
are installed with mpicc and get the required MPI libraries and includes by 
default. I have done this with R-2.13.0 on an Opteron cluster running CentOS-5 
a while ago and so far it has worked out great.

I crosspost to r-sig-hpc and welcome others to comment if there are potential 
downsides to this solution.

George


> Michael Spiegel michael.m.spiegel at gmail.com 
>  NSTALL%20configure.args%20and%20CC%20customization&In-Reply-To=%3CCANw
> u5-rGUYrC73vRo04GJCdW_ZQerycbVU4K_2Dun1ytqNXQ7g%40mail.gmail.com%3E>
> /Fri Sep 9 20:40:42 CEST 2011/
> I am running into the following issue that has been previously 
> reported on the R-devel mailing list. The short version is that I'm 
> writing a package for MPI, and I'd like to change CC and SHLIB_LD to 
> "mpicc". Trying to change them in Makevars.in has no effect, because 
> the values are clobbered by /etc/R/Makeconf. Will the following 
> changes to Makeconf.in introduce any problems?
>
> --Michael

--
George Ostrouchov
Statistics and Data Sciences Group
Computer Science and Mathematics Division Oak Ridge National Laboratory
(865) 574-3137  http://www.csm.ornl.gov/~ost


[[alternative HTML version deleted]]

___
R-sig-hpc mailing list
r-sig-...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-hpc

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


Re: [Rd] BitSet equivalent? Java code usable?

2011-10-12 Thread Tommy Fortes
If you don't have NAs in your bits, you might be able to use the raw
vector type. A raw value is one byte (8 bits), doesn't support NAs and
supports bit operations on all the bits at once:

  &, |, !, xor

You'd probably want to wrap it into a class that allows a more
BitSet-like view of it though. Maybe there's a package out there that
does that already?

...and if you DO have NAs, you could use two raw vectors (or two
consecutive raw-vector bits per BitSet bit).

Good luck!

/Tommy

2011/10/8 Uwe Ligges :
>
>
> On 07.10.2011 19:01, Joachim Harloff wrote:
>>
>> Hi all,
>>
>> I consider writing a R package on statistics for the sorting method as a
>> hobby. I have written a private Java application that I could use as a
>> basis. Therefore I'd like to ask two questions:
>>
>> 1) logical vectors: Bit storage (small) and capable of bit operations?
>> The Java application relies on BitSet(s) for efficiency reasons. Arrays of
>> logical values cost far too much memory (in the 2nd level heap etc.) while
>> chunks of BitSets easily fit into the first processor cache. Moreover the
>> Bit operations or, xor, and, andnot, cardinality, clone, flip, equals,
>> intersects are much faster done for BitSets than equivalent functions
>> written for logical arrays. Is there any equivalent for BitSet in R? The
>> vector type "logical" seems to be not equally powerful and I do not know its
>> memory requirements. In BitSets a Bit requires just one Bit, no more.
>
> Logical values in R do have at least 3 values: TRUE, FALSE and NA, hence
> cannot be implemented in one bit.
>
>
>> 2) Can Java code be used?
>> Can I use some Java code for a R package (without translating it first to
>> C. This is not always simple)? Probably this sounds ugly but it would
>> greatly simplify the task for me.
>
> See the rJava package.
>
> Best,
> Uwe Ligges
>
>
>>
>> Regards,
>> Joachim Harloff
>>
>> __
>> 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
>

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


[Rd] trace an Rd conversion error in R cmd check

2011-10-12 Thread Joshua Wiley
Hi All,

Apologies if this is a very naive question.  Is there a way to see the
particular Rd file being processed right before a warning/error
occurs?  As far as I can tell, all my .Rd files use have names and
titles and they are unique between Rd files (sometimes in a file I use
something like \name{foo} \title{Foo}).  I seem to be able to convert
files to latex using: R CMD Rdconv --type=latex on all my Rd files
without problems.

Here is the warning and error:

* checking PDF version of manual ... ERROR
Rd conversion errors:
Warning in file(con, "r") :
  file("") only supports open = "w+" and open = "w+b": using the former
Error : : Sections \title, and \name must exist and be unique in Rd files

I am using:

R Under development (unstable) (2011-10-11 r57214)
Platform: x86_64-pc-mingw32/x64 (64-bit)
on Windows 7 with Rtools 2.14 and MikTeX 2.9

Any suggestions or pointers to manuals/documentation would be greatly
appreciated.

Thanks,

Josh


-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

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


Re: [Rd] trace an Rd conversion error in R cmd check

2011-10-12 Thread Duncan Murdoch

On 11-10-12 3:24 AM, Joshua Wiley wrote:

Hi All,

Apologies if this is a very naive question.  Is there a way to see the
particular Rd file being processed right before a warning/error
occurs?  As far as I can tell, all my .Rd files use have names and
titles and they are unique between Rd files (sometimes in a file I use
something like \name{foo} \title{Foo}).  I seem to be able to convert
files to latex using: R CMD Rdconv --type=latex on all my Rd files
without problems.

Here is the warning and error:

* checking PDF version of manual ... ERROR
Rd conversion errors:
Warning in file(con, "r") :
   file("") only supports open = "w+" and open = "w+b": using the former
Error : : Sections \title, and \name must exist and be unique in Rd files


It does normally list the name.  In your case, that appears to be "", 
based on the warning.


I don't know how this would come about (I don't believe "" is a legal 
filename in Windows).


If you could make a copy of the package available, I might be able to 
track this down.


Duncan Murdoch



I am using:

R Under development (unstable) (2011-10-11 r57214)
Platform: x86_64-pc-mingw32/x64 (64-bit)
on Windows 7 with Rtools 2.14 and MikTeX 2.9

Any suggestions or pointers to manuals/documentation would be greatly
appreciated.

Thanks,

Josh




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


Re: [Rd] trace an Rd conversion error in R cmd check

2011-10-12 Thread Prof Brian Ripley
R CMD check is R code: you can run the R code for yourself using R's 
debugging facilities.  In this case start with 'R CMD Rd2pdf pkg-name' 
(which should give the same error, as that is what R CMD check calls), 
then run that R code directly (there are comments in the code in 
R-devel about how to do so).


On Wed, 12 Oct 2011, Joshua Wiley wrote:


Hi All,

Apologies if this is a very naive question.  Is there a way to see the
particular Rd file being processed right before a warning/error
occurs?  As far as I can tell, all my .Rd files use have names and
titles and they are unique between Rd files (sometimes in a file I use
something like \name{foo} \title{Foo}).  I seem to be able to convert
files to latex using: R CMD Rdconv --type=latex on all my Rd files
without problems.

Here is the warning and error:

* checking PDF version of manual ... ERROR
Rd conversion errors:
Warning in file(con, "r") :
 file("") only supports open = "w+" and open = "w+b": using the former
Error : : Sections \title, and \name must exist and be unique in Rd files

I am using:

R Under development (unstable) (2011-10-11 r57214)
Platform: x86_64-pc-mingw32/x64 (64-bit)
on Windows 7 with Rtools 2.14 and MikTeX 2.9

Any suggestions or pointers to manuals/documentation would be greatly
appreciated.


This is far too rare a problem to be documented in detail.


Thanks,

Josh


--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

__
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] NOTE: unstated dependencies in examples

2011-10-12 Thread Michael Friendly
Using R 2.13.1, I am now getting the following NOTE when I run R CMD 
check on my HistData

package

* checking for unstated dependencies in examples ... NOTE
'library' or 'require' calls not declared from:
  gplots sp

Under R 2.12.x, I didn't get these notes.

I have ~ 25 .Rd files in this package, and AFAICS, every example uses 
library or require for the
functions used;  the DESCRIPTION file has the long list of Suggests, 
which previously was sufficient

for packages used in examples.

Suggests: gtools, KernSmooth, maps, ggplot2, proto, grid, reshape, plyr, 
lattice, ReadImages, car


But I have no way to find the .Rd file(s) that triggered this note.

 What is the tool used in R CMD check to make this diagnosis?  It would 
be better

if this reported the .Rd file(s) that triggered this note.
Is it possible that this note could be specious?

-Michael

--
Michael Friendly Email: friendly AT yorku DOT ca
Professor, Psychology Dept.
York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele StreetWeb:   http://www.datavis.ca
Toronto, ONT  M3J 1P3 CANADA

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


Re: [Rd] trace an Rd conversion error in R cmd check

2011-10-12 Thread Joshua Wiley
Thanks to Drs. Murdoch and Ripley for your fast and helpful replies.
I did not realize that R CMD check was R code, so that was incredibly
useful.

I spent the morning working on debugging this, and I think I must have
messed up setting up the Windows tool chain, because I get the error
even when running R CMD check on other packages (e.g., MASS).  I am
still not sure what exactly I am missing/setup incorrectly.  R
compiled from source and passed make check all without any trouble.  I
can install packages, and I can make PDFs using tools:::..Rd2pdf, but
when I try to use Rd2pdf on a package instead of specific files I get
the error.

Looking at the R code for CMD check helped me better understand the
process and I will just work with my tool chain until I get things
working.

Thanks again!

Josh



On Wed, Oct 12, 2011 at 4:10 AM, Prof Brian Ripley
 wrote:
> R CMD check is R code: you can run the R code for yourself using R's
> debugging facilities.  In this case start with 'R CMD Rd2pdf pkg-name'
> (which should give the same error, as that is what R CMD check calls), then
> run that R code directly (there are comments in the code in R-devel about
> how to do so).
>
> On Wed, 12 Oct 2011, Joshua Wiley wrote:
>
>> Hi All,
>>
>> Apologies if this is a very naive question.  Is there a way to see the
>> particular Rd file being processed right before a warning/error
>> occurs?  As far as I can tell, all my .Rd files use have names and
>> titles and they are unique between Rd files (sometimes in a file I use
>> something like \name{foo} \title{Foo}).  I seem to be able to convert
>> files to latex using: R CMD Rdconv --type=latex on all my Rd files
>> without problems.
>>
>> Here is the warning and error:
>>
>> * checking PDF version of manual ... ERROR
>> Rd conversion errors:
>> Warning in file(con, "r") :
>>  file("") only supports open = "w+" and open = "w+b": using the former
>> Error : : Sections \title, and \name must exist and be unique in Rd files
>>
>> I am using:
>>
>> R Under development (unstable) (2011-10-11 r57214)
>> Platform: x86_64-pc-mingw32/x64 (64-bit)
>> on Windows 7 with Rtools 2.14 and MikTeX 2.9
>>
>> Any suggestions or pointers to manuals/documentation would be greatly
>> appreciated.
>
> This is far too rare a problem to be documented in detail.
>
>> Thanks,
>>
>> Josh
>>
>>
>> --
>> Joshua Wiley
>> Ph.D. Student, Health Psychology
>> Programmer Analyst II, ATS Statistical Consulting Group
>> University of California, Los Angeles
>> https://joshuawiley.com/
>>
>> __
>> 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, UK                Fax:  +44 1865 272595
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

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


Re: [Rd] trace an Rd conversion error in R cmd check

2011-10-12 Thread Spencer Graves

Hi, Josh:


  Have you had a recent version that passed "R CMD check"?  If yes, 
I suggest you save your recent changes then revert to that earlier 
version and add your recent changes back in again one at a time.  I've 
done that many times.  (It's also a major reason I make changes as small 
as I can and run "R CMD check" after each one.  Then if I get something 
like this I can't figure out, there aren't many changes to scan through 
to find the problem.)



  Hope this helps.
  Spencer


On 10/12/2011 4:10 AM, Prof Brian Ripley wrote:

R CMD check is R code: you can run the R code for yourself using R's
debugging facilities.  In this case start with 'R CMD Rd2pdf pkg-name'
(which should give the same error, as that is what R CMD check calls),
then run that R code directly (there are comments in the code in
R-devel about how to do so).

On Wed, 12 Oct 2011, Joshua Wiley wrote:


Hi All,

Apologies if this is a very naive question.  Is there a way to see the
particular Rd file being processed right before a warning/error
occurs?  As far as I can tell, all my .Rd files use have names and
titles and they are unique between Rd files (sometimes in a file I use
something like \name{foo} \title{Foo}).  I seem to be able to convert
files to latex using: R CMD Rdconv --type=latex on all my Rd files
without problems.

Here is the warning and error:

* checking PDF version of manual ... ERROR
Rd conversion errors:
Warning in file(con, "r") :
 file("") only supports open = "w+" and open = "w+b": using the former
Error : : Sections \title, and \name must exist and be unique in Rd
files

I am using:

R Under development (unstable) (2011-10-11 r57214)
Platform: x86_64-pc-mingw32/x64 (64-bit)
on Windows 7 with Rtools 2.14 and MikTeX 2.9

Any suggestions or pointers to manuals/documentation would be greatly
appreciated.


This is far too rare a problem to be documented in detail.


Thanks,

Josh


--
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

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






--
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com

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


Re: [Rd] trace an Rd conversion error in R cmd check

2011-10-12 Thread William Dunlap
Good luck in tracking down the problem.  I won't give
any help there.

I've seen this sort of error message (or worse) when using
system.file() and the desired file didn't exist.  If that
is the problem, add the newish argument mustWork=TRUE to
the call to system.file so you get an error message from system.file
instead of a warning or inappropriate behavior from the function
that is confused by the "" that system.file() returns when the
desired file doesn't exist.

  > con <- file(system.file(package="base", "noSuchFile"), "r")
  Warning message:
  In file(system.file(package = "base", "noSuchFile"), "r") :
file("") only supports open = "w+" and open = "w+b": using the former
  > con <- file(system.file(package="base", "noSuchFile", mustWork=TRUE), "r")
  Error in system.file(package = "base", "noSuchFile", mustWork = TRUE) : 
no file found

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com 

> -Original Message-
> From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On 
> Behalf Of Joshua Wiley
> Sent: Wednesday, October 12, 2011 9:46 AM
> To: r-devel@r-project
> Subject: Re: [Rd] trace an Rd conversion error in R cmd check
> 
> Thanks to Drs. Murdoch and Ripley for your fast and helpful replies.
> I did not realize that R CMD check was R code, so that was incredibly
> useful.
> 
> I spent the morning working on debugging this, and I think I must have
> messed up setting up the Windows tool chain, because I get the error
> even when running R CMD check on other packages (e.g., MASS).  I am
> still not sure what exactly I am missing/setup incorrectly.  R
> compiled from source and passed make check all without any trouble.  I
> can install packages, and I can make PDFs using tools:::..Rd2pdf, but
> when I try to use Rd2pdf on a package instead of specific files I get
> the error.
> 
> Looking at the R code for CMD check helped me better understand the
> process and I will just work with my tool chain until I get things
> working.
> 
> Thanks again!
> 
> Josh
> 
> 
> 
> On Wed, Oct 12, 2011 at 4:10 AM, Prof Brian Ripley
>  wrote:
> > R CMD check is R code: you can run the R code for yourself using R's
> > debugging facilities.  In this case start with 'R CMD Rd2pdf pkg-name'
> > (which should give the same error, as that is what R CMD check calls), then
> > run that R code directly (there are comments in the code in R-devel about
> > how to do so).
> >
> > On Wed, 12 Oct 2011, Joshua Wiley wrote:
> >
> >> Hi All,
> >>
> >> Apologies if this is a very naive question.  Is there a way to see the
> >> particular Rd file being processed right before a warning/error
> >> occurs?  As far as I can tell, all my .Rd files use have names and
> >> titles and they are unique between Rd files (sometimes in a file I use
> >> something like \name{foo} \title{Foo}).  I seem to be able to convert
> >> files to latex using: R CMD Rdconv --type=latex on all my Rd files
> >> without problems.
> >>
> >> Here is the warning and error:
> >>
> >> * checking PDF version of manual ... ERROR
> >> Rd conversion errors:
> >> Warning in file(con, "r") :
> >>  file("") only supports open = "w+" and open = "w+b": using the former
> >> Error : : Sections \title, and \name must exist and be unique in Rd files
> >>
> >> I am using:
> >>
> >> R Under development (unstable) (2011-10-11 r57214)
> >> Platform: x86_64-pc-mingw32/x64 (64-bit)
> >> on Windows 7 with Rtools 2.14 and MikTeX 2.9
> >>
> >> Any suggestions or pointers to manuals/documentation would be greatly
> >> appreciated.
> >
> > This is far too rare a problem to be documented in detail.
> >
> >> Thanks,
> >>
> >> Josh
> >>
> >>
> >> --
> >> Joshua Wiley
> >> Ph.D. Student, Health Psychology
> >> Programmer Analyst II, ATS Statistical Consulting Group
> >> University of California, Los Angeles
> >> https://joshuawiley.com/
> >>
> >> __
> >> 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, UK                Fax:  +44 1865 272595
> >
> 
> 
> 
> --
> Joshua Wiley
> Ph.D. Student, Health Psychology
> Programmer Analyst II, ATS Statistical Consulting Group
> University of California, Los Angeles
> https://joshuawiley.com/
> 
> __
> 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


[Rd] a couple of small problems with current R devel branch

2011-10-12 Thread Hin-Tak Leung
These are small enough problems with R devel branch yesterday I thought I'll 
just post here and hope somebody will fix them soon (or may have already been 
fixed today), rather than filing at the bugzilla.

- "R CMD check --use-valgrind --use-gct " gives:

--
Error in gzfile(file, "rb") : 
  can only weakly reference/finalize reference objects
Calls: library -> find.package -> lapply -> FUN -> readRDS -> gzfile
Execution halted
--

That doesn't comes from my code - it appears that the "--use-valgrind --use-gct 
" options does not like readRDS(), which is in the base package.

- a small typo in "R/src/library/base/man/readRDS.Rd" while I looked at the 
error above - note the repeated "support for":


  interface has been stable since \R 1.7.0, except that support for
  support for types of compression was added in \R 2.10.0 (previously


TIA.


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


Re: [Rd] how to make a true binary package?

2011-10-12 Thread Greg Snow
If you want to hide some code from accidental or casual sight then I have had 
some success with adding something like this to the .R file for a package (the 
petals function in TeachingDemos in this case):

.onAttach <- function(...) {
petals <- petals
attr(petals,'source') <- "Don't Cheat!"
assign('petals',petals,'package:TeachingDemos')
}

Though that would only slow an experienced R programmer down by maybe 10 
seconds if they really wanted to see the code, it might take an intermediate 
level R programmer a whole minute to figure out how to work around this.  But 
it would prevent an honest user that knew of a license or agreement to not look 
at the code from accidentally seeing what they agreed not to.

You could also include something in the code that checked the attribute and 
stopped working if it was changed or somehow notified you of the change.  
Combining this with the license agreements as others have said might give you 
additional recourse.

You can see the petals.R file in the TeachingDemos package on R-forge for 
another example of obfuscating (bleaching) a key piece of code.  Combining the 
2 might slow down an expert by a whole 30 seconds, but at least they would not 
be able to claim that they accidentally saw the code.

Whether this violates the spirit of R licensing or not is another issue.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -Original Message-
> From: r-devel-boun...@r-project.org [mailto:r-devel-bounces@r-
> project.org] On Behalf Of A Zege
> Sent: Tuesday, October 11, 2011 11:09 AM
> To: r-devel@r-project.org
> Subject: Re: [Rd] how to make a true binary package?
> 
> OK, gentlemen, i agree with you in general. I was not talking about a
> general
> purpose, general use package that one prepares for CRAN. I am sure you
> are
> familiar professionally or can imagine situations where you need to
> demonstrate a solution to a specific task without fully disclosing the
> details -- sometimes even hard core open source adherents need to
> sacrifice
> desire for openness for some prosaic purposes, like getting paid :).
> Compilable languages give an easy solution of a binary code. It sounds
> like
> if one wants true binary, he has to recode in C++. I thought it's
> possible
> in R as well, i thought this was discussed even as a default behavior
> for
> next version of R to make stuff go faster. Maybe not. Thanks, anyway.
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-
> make-a-true-binary-package-tp3895117p3895262.html
> Sent from the R devel mailing list archive at Nabble.com.
> 
> __
> 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] how to make a true binary package?

2011-10-12 Thread Duncan Murdoch

On 12/10/2011 3:57 PM, Greg Snow wrote:

If you want to hide some code from accidental or casual sight then I have had 
some success with adding something like this to the .R file for a package (the 
petals function in TeachingDemos in this case):

.onAttach<- function(...) {
 petals<- petals
 attr(petals,'source')<- "Don't Cheat!"
 assign('petals',petals,'package:TeachingDemos')
}

Though that would only slow an experienced R programmer down by maybe 10 
seconds if they really wanted to see the code, it might take an intermediate 
level R programmer a whole minute to figure out how to work around this.  But 
it would prevent an honest user that knew of a license or agreement to not look 
at the code from accidentally seeing what they agreed not to.


You should be aware that this will no longer work in R 2.14.0, which 
finally drops the "source" attribute.  This would achieve a similar effect:


srcfile <- srcfilecopy("", "Don't cheat")
srcref <- srcref(srcfile, c(1,1,1,12))
attr(petals, "srcref") <- srcref

Duncan Murdoch


You could also include something in the code that checked the attribute and 
stopped working if it was changed or somehow notified you of the change.  
Combining this with the license agreements as others have said might give you 
additional recourse.

You can see the petals.R file in the TeachingDemos package on R-forge for 
another example of obfuscating (bleaching) a key piece of code.  Combining the 
2 might slow down an expert by a whole 30 seconds, but at least they would not 
be able to claim that they accidentally saw the code.

Whether this violates the spirit of R licensing or not is another issue.



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


Re: [Rd] NOTE: unstated dependencies in examples

2011-10-12 Thread Yihui Xie
You have this in Jevons.Rd:

# show as balloonplots

if (require(gplots)) {


and this in Snow.Rd:

%\dontrun{

library(sp)


It will certainly be helpful if R CMD check can provide more
informative messages (in this case, e.g, point out the Rd files).

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Oct 12, 2011 at 11:33 AM, Michael Friendly  wrote:
> Using R 2.13.1, I am now getting the following NOTE when I run R CMD check
> on my HistData
> package
>
> * checking for unstated dependencies in examples ... NOTE
> 'library' or 'require' calls not declared from:
>  gplots sp
>
> Under R 2.12.x, I didn't get these notes.
>
> I have ~ 25 .Rd files in this package, and AFAICS, every example uses
> library or require for the
> functions used;  the DESCRIPTION file has the long list of Suggests, which
> previously was sufficient
> for packages used in examples.
>
> Suggests: gtools, KernSmooth, maps, ggplot2, proto, grid, reshape, plyr,
> lattice, ReadImages, car
>
> But I have no way to find the .Rd file(s) that triggered this note.
>
>  What is the tool used in R CMD check to make this diagnosis?  It would be
> better
> if this reported the .Rd file(s) that triggered this note.
> Is it possible that this note could be specious?
>
> -Michael
>
> --
> Michael Friendly     Email: friendly AT yorku DOT ca
> Professor, Psychology Dept.
> York University      Voice: 416 736-5115 x66249 Fax: 416 736-5814
> 4700 Keele Street    Web:   http://www.datavis.ca
> Toronto, ONT  M3J 1P3 CANADA
>
> __
> 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] trace an Rd conversion error in R cmd check

2011-10-12 Thread Joshua Wiley
Hi Spencer,

Yes, I have versions that pass, but it is not package specific (i.e.,
I can download other package sources from CRAN and if I run R CMD
check on them, I get the same error).  When I run R CMD check using R
2.13.1 or R 2.13.2 it is fine.  Using either:

compiled from source:
R Under development (unstable) (2011-10-12 r57226)
Platform: x86_64-pc-mingw32/x64 (64-bit)

pre-built binary:
R Under development (unstable) (2011-10-10 r57203)
Platform: x86_64-pc-mingw32/x64 (64-bit)

I get the file error.  I am going to keep poking around and try Bill's
suggestion adding mustWork=TRUE.

Cheers,

Josh

On Wed, Oct 12, 2011 at 10:12 AM, Spencer Graves
 wrote:
> Hi, Josh:
>
>
>      Have you had a recent version that passed "R CMD check"?  If yes, I
> suggest you save your recent changes then revert to that earlier version and
> add your recent changes back in again one at a time.  I've done that many
> times.  (It's also a major reason I make changes as small as I can and run
> "R CMD check" after each one.  Then if I get something like this I can't
> figure out, there aren't many changes to scan through to find the problem.)
>
>
>      Hope this helps.
>      Spencer
>
>
> On 10/12/2011 4:10 AM, Prof Brian Ripley wrote:
>>
>> R CMD check is R code: you can run the R code for yourself using R's
>> debugging facilities.  In this case start with 'R CMD Rd2pdf pkg-name'
>> (which should give the same error, as that is what R CMD check calls),
>> then run that R code directly (there are comments in the code in
>> R-devel about how to do so).
>>
>> On Wed, 12 Oct 2011, Joshua Wiley wrote:
>>
>>> Hi All,
>>>
>>> Apologies if this is a very naive question.  Is there a way to see the
>>> particular Rd file being processed right before a warning/error
>>> occurs?  As far as I can tell, all my .Rd files use have names and
>>> titles and they are unique between Rd files (sometimes in a file I use
>>> something like \name{foo} \title{Foo}).  I seem to be able to convert
>>> files to latex using: R CMD Rdconv --type=latex on all my Rd files
>>> without problems.
>>>
>>> Here is the warning and error:
>>>
>>> * checking PDF version of manual ... ERROR
>>> Rd conversion errors:
>>> Warning in file(con, "r") :
>>>  file("") only supports open = "w+" and open = "w+b": using the former
>>> Error : : Sections \title, and \name must exist and be unique in Rd
>>> files
>>>
>>> I am using:
>>>
>>> R Under development (unstable) (2011-10-11 r57214)
>>> Platform: x86_64-pc-mingw32/x64 (64-bit)
>>> on Windows 7 with Rtools 2.14 and MikTeX 2.9
>>>
>>> Any suggestions or pointers to manuals/documentation would be greatly
>>> appreciated.
>>
>> This is far too rare a problem to be documented in detail.
>>
>>> Thanks,
>>>
>>> Josh
>>>
>>>
>>> --
>>> Joshua Wiley
>>> Ph.D. Student, Health Psychology
>>> Programmer Analyst II, ATS Statistical Consulting Group
>>> University of California, Los Angeles
>>> https://joshuawiley.com/
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>
>
>
> --
> Spencer Graves, PE, PhD
> President and Chief Technology Officer
> Structure Inspection and Monitoring, Inc.
> 751 Emerson Ct.
> San José, CA 95126
> ph:  408-655-4567
> web:  www.structuremonitoring.com
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
Programmer Analyst II, ATS Statistical Consulting Group
University of California, Los Angeles
https://joshuawiley.com/

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