[Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Art Eschenlauer
When I did install.packages(sqldf) on Windows and Mac OSX, it installed
fine.
However, when I did it on my Debian Squeeze box under R 2.14.0, it failed.
I discovered that three of the dependent packages, chron, proto, and
gsubfn, do not include a NAMESPACE file in their distribution tar.gz files.
I contacted the developer, who told me that, for packages without a
NAMESPACE file, R 2.14 (but not early versions of R) generates a NAMESPACE
file.

My workaround to get sqldf installed was to copy the generated NAMESPACE
files from my Mac to my Debian squeeze box and use R CMD INSTALL to install
the packages.

Although I read
   As from R 2.14.0 all packages will be installed with a namespace:
   rather than relying on this mechanism authors are strongly
   encouraged to add a namespace for themselves.
on
   http://cran.r-project.org/doc/manuals/R-exts.html#Package-namespaces
it nevertheless appears to me that this behavior (not generating NAMESPACE
files) is peculiar to my Debian installation (since it worked on the
Windows and Mac machines).

Please let me know if you need more details or further research.

R totally ROCKS!

[[alternative HTML version deleted]]

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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Uwe Ligges

I think many people like to help, but we cannot:

You say you are under R-2.14.0 and whn you R CMD INSTALL a package with 
that version of R, it does not have a NAMESPACE in the end?

Then

 - your R installation is broken or
 - you are looking into a library where you have old versios of the 
packages or
 - you belive you are using R-2.14.0 but you are actually using an 
older version.


Uwe ligges


On 08.11.2011 10:49, Art Eschenlauer wrote:

When I did install.packages(sqldf) on Windows and Mac OSX, it installed
fine.
However, when I did it on my Debian Squeeze box under R 2.14.0, it failed.
I discovered that three of the dependent packages, chron, proto, and
gsubfn, do not include a NAMESPACE file in their distribution tar.gz files.
I contacted the developer, who told me that, for packages without a
NAMESPACE file, R 2.14 (but not early versions of R) generates a NAMESPACE
file.

My workaround to get sqldf installed was to copy the generated NAMESPACE
files from my Mac to my Debian squeeze box and use R CMD INSTALL to install
the packages.

Although I read
As from R 2.14.0 all packages will be installed with a namespace:
rather than relying on this mechanism authors are strongly
encouraged to add a namespace for themselves.
on
http://cran.r-project.org/doc/manuals/R-exts.html#Package-namespaces
it nevertheless appears to me that this behavior (not generating NAMESPACE
files) is peculiar to my Debian installation (since it worked on the
Windows and Mac machines).

Please let me know if you need more details or further research.

R totally ROCKS!

[[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] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Gabor Grothendieck
2011/11/8 Uwe Ligges lig...@statistik.tu-dortmund.de:
 I think many people like to help, but we cannot:

 You say you are under R-2.14.0 and whn you R CMD INSTALL a package with that
 version of R, it does not have a NAMESPACE in the end?
 Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the packages
 or
  - you belive you are using R-2.14.0 but you are actually using an older
 version.


This is even reproduced on CRAN.  All platforms work except one:

http://cran.r-project.org/web/checks/check_results_sqldf.html


-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Gabor Grothendieck
On Tue, Nov 8, 2011 at 10:31 AM, Gabor Grothendieck
ggrothendi...@gmail.com wrote:
 2011/11/8 Uwe Ligges lig...@statistik.tu-dortmund.de:
 I think many people like to help, but we cannot:

 You say you are under R-2.14.0 and whn you R CMD INSTALL a package with that
 version of R, it does not have a NAMESPACE in the end?
 Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the packages
 or
  - you belive you are using R-2.14.0 but you are actually using an older
 version.


 This is even reproduced on CRAN.  All platforms work except one:

 http://cran.r-project.org/web/checks/check_results_sqldf.html


HIt send by mistake.

I understand that its being fixed already on CRAN for that platform.


-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Uwe Ligges



On 08.11.2011 16:31, Gabor Grothendieck wrote:

2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:

I think many people like to help, but we cannot:

You say you are under R-2.14.0 and whn you R CMD INSTALL a package with that
version of R, it does not have a NAMESPACE in the end?
Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the packages
or
  - you belive you are using R-2.14.0 but you are actually using an older
version.



This is even reproduced on CRAN.  All platforms work except one:

http://cran.r-project.org/web/checks/check_results_sqldf.html


No, that one is completely unrelated (and already solved, but not yet 
synced to CRAN master) to the original question you have removed in your 
reply.


The essential part of the question was: However, when I did it on my 
Debian Squeeze box under R 2.14.0, it failed. and it does not fail 
under any R-2.14.0 if you look at the page you cited above.


Best,
Uwe Ligges

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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Gabor Grothendieck
2011/11/8 Uwe Ligges lig...@statistik.tu-dortmund.de:


 On 08.11.2011 16:31, Gabor Grothendieck wrote:

 2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:

 I think many people like to help, but we cannot:

 You say you are under R-2.14.0 and whn you R CMD INSTALL a package with
 that
 version of R, it does not have a NAMESPACE in the end?
 Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the
 packages
 or
  - you belive you are using R-2.14.0 but you are actually using an older
 version.


 This is even reproduced on CRAN.  All platforms work except one:

 http://cran.r-project.org/web/checks/check_results_sqldf.html

 No, that one is completely unrelated (and already solved, but not yet synced
 to CRAN master) to the original question you have removed in your reply.


OK.  One would have thought that the checks on CRAN would be
consistent with the package pages which link to them.  The summary
table at check_results_sqldf.html does not actually give the version
that is being tested so its only by clicking each of the links on the
summary table that one would uncover this inconsistency.

Regarding quoting, the mail server seems to reject posts from gmail
for all sorts of unknown reasons and quoting large posts very well
might be one of them so one has to be extremely careful.  For a while
(this is some time ago) I was unable to post at all but over time
learned that if I was sure to bottom rather than top post and not
quote too much then it would get through.

-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] CRAN: How to list a non-Sweave doc under Vignettes: on package page?

2011-11-08 Thread Claudia Beleites

Hi,

here's what I do:

I have two vignettes that are actually proper .Rnw files but the size of 
the data used is not acceptable for CRAN nor polite to any unsuspecting 
user.


So
- (I provide the original .Rnw and the data for download at r-forge)
- produce a .pdf from there in a directory external to the package
- have a fake .Rnw in the vignettes directory (actually still 
inst/doc) that provides the keywords for the vignette listing:

--- beginning of chondro.Rnw ---
% for the real source, see http://hyperspec.r-forge.r-project.org/


% \VignetteIndexEntry{Vignette on the chondro data set. Shows common 
Preprocessing tasks for Raman spectra, principal component analysis 
(PCA), and hierarchical cluster analysis.}
% \VignetteKeywords{chondro, hyperSpec, cluster analysis, preprocessing, 
Raman, principal component analysis, PCA}

% \VignettePackage{hyperSpec}

--- end of chondro.Rnw ---

- and have a Makefile in the directory with the relevant parts:

chondro.pdf:
rm -f chondro.tex

%.pdf: %.Rnw
	$(R_HOME)/bin/Rscript -e library (tools); Sweave(\$(F)\); 
texi2dvi(\$(basename $(F)).tex\, pdf = TRUE, clean = TRUE);
	gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen 
-dAutoRotatePages=/None \
	-dDownsampleColorImages=false -dNOPAUSE -dQUIET -dBATCH 
-dDownsampleColorImages=false \

-sOutputFile=tmp.pdf $@  qpdf tmp.pdf $@
rm tmp.pdf
rm -rf fig
rm -f $(basename $(F)).tex
rm -f Rplots.pdf

It is important that the .Rnw actually works - the Makefile is used only 
_after_ Sweaving. But the makefile ensures that the .pdf of 
corresponding name is not destroyed during the attempt to build it from 
the .Rnw.


You can find the complete directory at:
https://r-forge.r-project.org/scm/viewvc.php/src/hyperSpec/inst/doc/?root=hyperspec

This way the vignette is listed correctly and I ship the .pdf only once. 
So in priciple, everything that is a pdf is not far from being first 
class citizen. The second class solution for non-pdf documents would be 
a pdf containing the link to the actual file.


I don't remember where I got the idea, but I think it was one of Dirk 
Eddelbüttel's packages. So: thanks, Dirk!



Best,

Claudia


Am 08.11.2011 05:23, schrieb Hadley Wickham:

How CRAN behaves and how the help package system behaves may be two
different problems.  My question is specifically on how CRAN works.

To have inst/doc/ documents to be listed on the package's help page,
you can add an inst/doc/index.html file, cf. Section 'Writing package
vignettes' in 'Writing R Extensions'. You can use the following
index.html file as a template:


But they still won't be listed under vignette() - I see this solution
as a temporary hack until non-Sweave vignettes become first class
citizens.

Hadley




--
Claudia Beleites
Spectroscopy/Imaging
Institute of Photonic Technology
Albert-Einstein-Str. 9
07745 Jena
Germany

email: claudia.belei...@ipht-jena.de
phone: +49 3641 206-133
fax:   +49 2641 206-399

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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Uwe Ligges



On 08.11.2011 17:04, Gabor Grothendieck wrote:

2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:



On 08.11.2011 16:31, Gabor Grothendieck wrote:


2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:


I think many people like to help, but we cannot:

You say you are under R-2.14.0 and whn you R CMD INSTALL a package with
that
version of R, it does not have a NAMESPACE in the end?
Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the
packages
or
  - you belive you are using R-2.14.0 but you are actually using an older
version.



This is even reproduced on CRAN.  All platforms work except one:

http://cran.r-project.org/web/checks/check_results_sqldf.html


No, that one is completely unrelated (and already solved, but not yet synced
to CRAN master) to the original question you have removed in your reply.



OK.  One would have thought that the checks on CRAN would be
consistent with the package pages which link to them.


I only see consistent information on that page.

And it should be like that within few hours after a change. Syncing the 
logs from at least 4 different sources and regenerating the overview 
page has to happen sometime and you can always visit between two updates 
so you may have seen an inconsistency that is no longer there.





The summary
table at check_results_sqldf.html does not actually give the version
that is being tested


It does, that's what the Version column contains. And the R version is 
also reported in the first column. You see check fro R-devel, R-release 
and R-oldrelease.


uwe




so its only by clicking each of the links on the
summary table that one would uncover this inconsistency.



Regarding quoting, the mail server seems to reject posts from gmail
for all sorts of unknown reasons and quoting large posts very well
might be one of them so one has to be extremely careful.  For a while
(this is some time ago) I was unable to post at all but over time
learned that if I was sure to bottom rather than top post and not
quote too much then it would get through.



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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Gabor Grothendieck
2011/11/8 Uwe Ligges lig...@statistik.tu-dortmund.de:


 On 08.11.2011 17:04, Gabor Grothendieck wrote:

 2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:


 On 08.11.2011 16:31, Gabor Grothendieck wrote:

 2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:

 I think many people like to help, but we cannot:

 You say you are under R-2.14.0 and whn you R CMD INSTALL a package with
 that
 version of R, it does not have a NAMESPACE in the end?
 Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the
 packages
 or
  - you belive you are using R-2.14.0 but you are actually using an
 older
 version.


 This is even reproduced on CRAN.  All platforms work except one:

 http://cran.r-project.org/web/checks/check_results_sqldf.html

 No, that one is completely unrelated (and already solved, but not yet
 synced
 to CRAN master) to the original question you have removed in your reply.


 OK.  One would have thought that the checks on CRAN would be
 consistent with the package pages which link to them.

 I only see consistent information on that page.

If you go to:

http://cran.r-project.org/web/packages/sqldf/index.html

then the tar.gz file was created using R-2.14.0 but if you then click
on the  check results  link on the same page it takes you to this:

http://cran.r-project.org/web/checks/check_results_sqldf.html

On the last link on that page it says ERROR and if click on that it
takes you to the output of the check which reveals that it was run
with R 2.13.2.

The Version column on check_results_sqldf.html page refers to the
package's version, not the R version.  To get the R version you must
know to click on each link.

If its feasible in terms of effort and run time to add the R version
used in a column on the check_results_sqldf.html page then that would
make the summary page more useful since it would be immediately
apparent not only what version of the package is being used but also
what version of R is being used in each case.

-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


[Rd] NAMESPACES for data only packages

2011-11-08 Thread Michael Friendly
the NEWS file for R-devel says

  *

Even data-only packages without *R* code need a namespace and so may
need to be installed under *R* 2.14.0 or later.


but what should this contain?  Can it simply be an empty NAMESPACE 
file?  I assume that data does not have to
be exported.

-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


[[alternative HTML version deleted]]

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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Uwe Ligges



On 08.11.2011 17:56, Gabor Grothendieck wrote:

2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:



On 08.11.2011 17:04, Gabor Grothendieck wrote:


2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:



On 08.11.2011 16:31, Gabor Grothendieck wrote:


2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:


I think many people like to help, but we cannot:

You say you are under R-2.14.0 and whn you R CMD INSTALL a package with
that
version of R, it does not have a NAMESPACE in the end?
Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the
packages
or
  - you belive you are using R-2.14.0 but you are actually using an
older
version.



This is even reproduced on CRAN.  All platforms work except one:

http://cran.r-project.org/web/checks/check_results_sqldf.html


No, that one is completely unrelated (and already solved, but not yet
synced
to CRAN master) to the original question you have removed in your reply.



OK.  One would have thought that the checks on CRAN would be
consistent with the package pages which link to them.


I only see consistent information on that page.


If you go to:

http://cran.r-project.org/web/packages/sqldf/index.html

then the tar.gz file was created using R-2.14.0 but if you then click
on the  check results  link on the same page it takes you to this:



Yes. the tar.gz was created with R-2.14.0.



http://cran.r-project.org/web/checks/check_results_sqldf.html

On the last link on that page it says ERROR and if click on that it
takes you to the output of the check which reveals that it was run
with R 2.13.2.


Yes, ince it is checked with different flavors of R, R-oldrelease, 
R-release, R-devel. See the first column!


A source package can be created with an version of R and checked under 
another version. There is onlyone source package on CRAN, but - just as 
an exmaple - binaries for R-2.13.x and R-2.14.x. Of course, the checks 
are applied with the versions stated on the check page. I think you 
haven't got the whole point of checking with different versions of R.





The Version column on check_results_sqldf.html page refers to the
package's version, not the R version.  To get the R version you must
know to click on each link.


No, no, no, no! See the first column!
It definitely states if R-olrelease, R-release, R-pacthed or R-devel is 
used!


Uwe





If its feasible in terms of effort and run time to add the R version
used in a column on the check_results_sqldf.html page then that would
make the summary page more useful since it would be immediately
apparent not only what version of the package is being used but also
what version of R is being used in each case.



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


Re: [Rd] NAMESPACES for data only packages

2011-11-08 Thread Joshua Wiley
Hi Michael,

You are correct that data does not *have* to be exported.  For
example, here is the contents of NAMESPACE for the datasets package
from a recent devel version:

# This package exports nothing (it uses lazydata)
# exportPattern(.)

Cheers,

Josh

On Tue, Nov 8, 2011 at 9:11 AM, Michael Friendly frien...@yorku.ca wrote:
 the NEWS file for R-devel says

  *

    Even data-only packages without *R* code need a namespace and so may
    need to be installed under *R* 2.14.0 or later.


 but what should this contain?  Can it simply be an empty NAMESPACE
 file?  I assume that data does not have to
 be exported.

 -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


        [[alternative HTML version deleted]]

 __
 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


Re: [Rd] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Gabor Grothendieck
2011/11/8 Uwe Ligges lig...@statistik.tu-dortmund.de:


 On 08.11.2011 17:56, Gabor Grothendieck wrote:

 2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:


 On 08.11.2011 17:04, Gabor Grothendieck wrote:

 2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:


 On 08.11.2011 16:31, Gabor Grothendieck wrote:

 2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:

 I think many people like to help, but we cannot:

 You say you are under R-2.14.0 and whn you R CMD INSTALL a package
 with
 that
 version of R, it does not have a NAMESPACE in the end?
 Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the
 packages
 or
  - you belive you are using R-2.14.0 but you are actually using an
 older
 version.


 This is even reproduced on CRAN.  All platforms work except one:

 http://cran.r-project.org/web/checks/check_results_sqldf.html

 No, that one is completely unrelated (and already solved, but not yet
 synced
 to CRAN master) to the original question you have removed in your
 reply.


 OK.  One would have thought that the checks on CRAN would be
 consistent with the package pages which link to them.

 I only see consistent information on that page.

 If you go to:

 http://cran.r-project.org/web/packages/sqldf/index.html

 then the tar.gz file was created using R-2.14.0 but if you then click
 on the  check results  link on the same page it takes you to this:


 Yes. the tar.gz was created with R-2.14.0.


 http://cran.r-project.org/web/checks/check_results_sqldf.html

 On the last link on that page it says ERROR and if click on that it
 takes you to the output of the check which reveals that it was run
 with R 2.13.2.

 Yes, ince it is checked with different flavors of R, R-oldrelease,
 R-release, R-devel. See the first column!

 A source package can be created with an version of R and checked under
 another version. There is onlyone source package on CRAN, but - just as an
 exmaple - binaries for R-2.13.x and R-2.14.x. Of course, the checks are
 applied with the versions stated on the check page. I think you haven't got
 the whole point of checking with different versions of R.



 The Version column on check_results_sqldf.html page refers to the
 package's version, not the R version.  To get the R version you must
 know to click on each link.

 No, no, no, no! See the first column!
 It definitely states if R-olrelease, R-release, R-pacthed or R-devel is
 used!


OK. That wasn't clear. It would be better if it actually identified
the release as R 2.13.2, etc.

-- 
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [Rd] NAMESPACES for data only packages

2011-11-08 Thread Prof Brian Ripley

Can we clarify:

As the NEWS says, to install a data-only package under 2.14.0 you need 
a namespace.  And if you do not give one installation will create one.


However, you can use an already-installed data-only package without a 
namespace under 2.14.x, but not under R-devel.  This is to allow a 
transition (e.g. many of the BioC 2.9 binary data-only packages did 
not have a namespace at the time).


On Tue, 8 Nov 2011, Joshua Wiley wrote:


Hi Michael,

You are correct that data does not *have* to be exported.  For
example, here is the contents of NAMESPACE for the datasets package
from a recent devel version:

# This package exports nothing (it uses lazydata)
# exportPattern(.)

Cheers,

Josh

On Tue, Nov 8, 2011 at 9:11 AM, Michael Friendly frien...@yorku.ca wrote:

the NEWS file for R-devel says

 *

   Even data-only packages without *R* code need a namespace and so may
   need to be installed under *R* 2.14.0 or later.


but what should this contain?  Can it simply be an empty NAMESPACE
file?  I assume that data does not have to
be exported.

-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


       [[alternative HTML version deleted]]

__
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



--
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] NAMESPACE file generation issue R 2.14.0 on Debian Squeeze

2011-11-08 Thread Uwe Ligges



On 08.11.2011 19:08, Gabor Grothendieck wrote:

2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:



On 08.11.2011 17:56, Gabor Grothendieck wrote:


2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:



On 08.11.2011 17:04, Gabor Grothendieck wrote:


2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:



On 08.11.2011 16:31, Gabor Grothendieck wrote:


2011/11/8 Uwe Liggeslig...@statistik.tu-dortmund.de:


I think many people like to help, but we cannot:

You say you are under R-2.14.0 and whn you R CMD INSTALL a package
with
that
version of R, it does not have a NAMESPACE in the end?
Then

  - your R installation is broken or
  - you are looking into a library where you have old versios of the
packages
or
  - you belive you are using R-2.14.0 but you are actually using an
older
version.



This is even reproduced on CRAN.  All platforms work except one:

http://cran.r-project.org/web/checks/check_results_sqldf.html


No, that one is completely unrelated (and already solved, but not yet
synced
to CRAN master) to the original question you have removed in your
reply.



OK.  One would have thought that the checks on CRAN would be
consistent with the package pages which link to them.


I only see consistent information on that page.


If you go to:

http://cran.r-project.org/web/packages/sqldf/index.html

then the tar.gz file was created using R-2.14.0 but if you then click
on the  check results  link on the same page it takes you to this:



Yes. the tar.gz was created with R-2.14.0.



http://cran.r-project.org/web/checks/check_results_sqldf.html

On the last link on that page it says ERROR and if click on that it
takes you to the output of the check which reveals that it was run
with R 2.13.2.


Yes, ince it is checked with different flavors of R, R-oldrelease,
R-release, R-devel. See the first column!

A source package can be created with an version of R and checked under
another version. There is onlyone source package on CRAN, but - just as an
exmaple - binaries for R-2.13.x and R-2.14.x. Of course, the checks are
applied with the versions stated on the check page. I think you haven't got
the whole point of checking with different versions of R.




The Version column on check_results_sqldf.html page refers to the
package's version, not the R version.  To get the R version you must
know to click on each link.


No, no, no, no! See the first column!
It definitely states if R-olrelease, R-release, R-pacthed or R-devel is
used!



OK. That wasn't clear. It would be better if it actually identified
the release as R 2.13.2, etc.


We do not want to change those fields daily: R-devel and R-patched 
typically change from day to day - and then things will really become 
inconsistent in some place.


Uwe

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


[Rd] Question on parsing R code from C

2011-11-08 Thread KR
Hi all,

I am facing the necessity to parse R code from C-side. As a first approximation 
the goal would be a re-implementation of the R shell (not Rgui).

I read the document at http://cran.r-project.org/doc/manuals/R-exts.html 
section 
5.12, and the related source code example. 

I have some questions:

1. I need to declare the types and function signatures that I am going to use 
for this task without having to actually include the R headers. Can I safely 
declare SEXP according to the following ?
typedef struct SEXP *unknwn_handle;
More in general, is there a reference document for the C API (listing function 
signatures, and type definitions) ?

2. If the parsed R code of the working implementation contain commands like 
plot(), will the opportune windows pop-up as if I were using the R shell (on 
both windows and unix systems) ?

3. What initialization do I need to perform to be in exactly the same starting 
state as if I had executed the R shell with the --vanilla option?


Any help or feedback is appreciated.

Thank you.

Kind regard

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


Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Simon Urbanek

On Nov 8, 2011, at 2:42 PM, KR wrote:

 Hi all,
 
 I am facing the necessity to parse R code from C-side. As a first 
 approximation 
 the goal would be a re-implementation of the R shell (not Rgui).
 
 I read the document at http://cran.r-project.org/doc/manuals/R-exts.html 
 section 
 5.12, and the related source code example. 
 
 I have some questions:
 
 1. I need to declare the types and function signatures that I am going to use 
 for this task without having to actually include the R headers. Can I safely 
 declare SEXP according to the following ?
 typedef struct SEXP *unknwn_handle;

I'm not sure I understand this really - it doesn't define SEXP. I would expect 
something like

typedef void *SEXP;

Which may work for declarations. Note, however, that for the actual code you'll 
need to include the headers anyway.


 More in general, is there a reference document for the C API (listing 
 function 
 signatures, and type definitions) ?
 

http://r.research.att.com/man/R-exts.html is the documentation and the headers 
(Rinternals.h mainly) is the canonical reference.


 2. If the parsed R code of the working implementation contain commands like 
 plot(), will the opportune windows pop-up as if I were using the R shell (on 
 both windows and unix systems) ?
 

It depends on your settings - plot() uses whatever graphics device you tell it 
to use, so plot() doesn't decide about that. If you use the proper interactive 
graphics device *and* make sure you're serving the REPL then it may work. 
Beware of interactions with your other parts, though, since you are responsible 
for ensuring that it works. 


 3. What initialization do I need to perform to be in exactly the same 
 starting 
 state as if I had executed the R shell with the --vanilla option?
 

It depends on the OS and the way you are initializing R. In the simple case 
pass the --vanilla as the argument when initializing R. Please read the 
section about embedding, it has examples. Also see the other R GUIs to 
understand the complexities involved.

BTW: you subject has absolutely nothing to do with your question - your'e 
asking about embedding R ;)

Cheers,
Simon



 
 Any help or feedback is appreciated.
 
 Thank you.
 
 Kind regard
 
 __
 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] Question on parsing R code from C

2011-11-08 Thread KR
Simon Urbanek simon.urbanek at r-project.org writes:
 I'm not sure I understand this really - it doesn't define SEXP. I would 
 expect 
something like
 
 typedef void *SEXP;
 
 Which may work for declarations. Note, however, that for the actual code 
you'll need to include the headers anyway.

Thanks for the prompt reply!

It's my understanding that using opaque pointers to hide implementation is fine 
(as long as they are not de-referenced nor the size of the actual struct is 
needed). I actually come out with the tentative typedef by looking at the 
sources, but I got confused by some conditional pre-processor directives so I 
was searching for confirmation.

For the actual code I can just declare the types (even opaques depending on the 
use) and function signatures that I strictly need by hand as long as I am doing 
it correctly (after all that's what is inside the headers, among with the stuff 
I don't need).

 http://r.research.att.com/man/R-exts.html is the documentation and the 
 headers 
(Rinternals.h
 mainly) is the canonical reference.

Understood, thanks.

  2. If the parsed R code of the working implementation contain commands like 
  plot(), will the opportune windows pop-up as if I were using the R shell 
  (on 
  both windows and unix systems) ?
  
 
 It depends on your settings - plot() uses whatever graphics device you tell 
 it 
to use, so plot() doesn't
 decide about that. If you use the proper interactive graphics device *and* 
make sure you're serving the
 REPL then it may work. Beware of interactions with your other parts, though, 
since you are responsible for
 ensuring that it works. 

I admit I am quite lost here, is there any code I can look at for examples? :P

 BTW: you subject has absolutely nothing to do with your question - your'e 
asking about embedding R ;)

H I may be excused because I copy and pasted the title of section 5.12 
(which seemed most relevant for what I wanted to achieve) :-)


Cheers

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


Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Simon Urbanek

On Nov 8, 2011, at 4:57 PM, KR wrote:

 Simon Urbanek simon.urbanek at r-project.org writes:
 I'm not sure I understand this really - it doesn't define SEXP. I would 
 expect 
 something like
 
 typedef void *SEXP;
 
 Which may work for declarations. Note, however, that for the actual code 
 you'll need to include the headers anyway.
 
 Thanks for the prompt reply!
 
 It's my understanding that using opaque pointers to hide implementation is 
 fine 


Except that you don't know what are macros, inlined functions and actual 
functions. If you are careful you can possibly fall back to external functions 
but, obviously, your code will be less efficient. I would still prefer 
including Rinternals.h - you must have a *really* good reason to not do so ;).


 (as long as they are not de-referenced nor the size of the actual struct is 
 needed). I actually come out with the tentative typedef by looking at the 
 sources, but I got confused by some conditional pre-processor directives so I 
 was searching for confirmation.
 
 For the actual code I can just declare the types (even opaques depending on 
 the 
 use) and function signatures that I strictly need by hand as long as I am 
 doing 
 it correctly (after all that's what is inside the headers, among with the 
 stuff 
 I don't need).
 
 http://r.research.att.com/man/R-exts.html is the documentation and the 
 headers 
 (Rinternals.h
 mainly) is the canonical reference.
 
 Understood, thanks.
 
 2. If the parsed R code of the working implementation contain commands like 
 plot(), will the opportune windows pop-up as if I were using the R shell 
 (on 
 both windows and unix systems) ?
 
 
 It depends on your settings - plot() uses whatever graphics device you tell 
 it 
 to use, so plot() doesn't
 decide about that. If you use the proper interactive graphics device *and* 
 make sure you're serving the
 REPL then it may work. Beware of interactions with your other parts, though, 
 since you are responsible for
 ensuring that it works. 
 
 I admit I am quite lost here, is there any code I can look at for examples? :P
 

The embedding code examples and existing GUIs.

It's not a trivial topic and you should be really familiar with R in order to 
venture there. Embedding R to perform computations is reasonably easy, but the 
moment you want to run it interactively like console R, you have to implement a 
bunch of callbacks and run the even loop (REPL). It is more tricky than it 
sounds, because you need to synchronize your app with the event loop, make sure 
you process system events etc. (Simple command line R is not that hard - there 
are examples in the R sources with stub implementations of the callbacks, but 
the complexity increases considerably the moment you start using any UI 
features in your app)



 BTW: you subject has absolutely nothing to do with your question - your'e 
 asking about embedding R ;)
 
 H I may be excused because I copy and pasted the title of section 5.12 
 (which seemed most relevant for what I wanted to achieve) :-)
 

;)

Cheers,
Simon

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


Re: [Rd] Question on parsing R code from C

2011-11-08 Thread KR
Simon Urbanek simon.urbanek at r-project.org writes:
 Except that you don't know what are macros, inlined functions and actual 
functions. If you are careful you
 can possibly fall back to external functions but, obviously, your code will 
 be 
less efficient. I would
 still prefer including Rinternals.h - you must have a *really* good reason to 
not do so ;)

Hmmm yes there are good motives (I am not completely unreasonable, yet :P) but 
I 
could probably cope with it if there is no other way.

Regarding the rest of the e-mail, please let me be clearer on what my goal is. 
I 
would need a function to create and initialize an R state, a function to close 
the state, and a function (R_ParseVector?) that takes as input the R state and 
a 
string (containing R code), evaluates the code and return an error code 
(error, incomplete, done) plus (eventually) a string containing the output of 
the computation.

In my application I do not have any UI elements (it's console based), but I 
would like calls to plot in R (and other functions using the graphic device) to 
function as they would under R.exe (on windows), i.e. have persistent windows 
popped up which you can resize ecc ecc. I naively thought that these graphic 
capabilities came automatically with the R_ParseVector via some threading 
techniques.

Thanks for all your comments!


Cheers

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


Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Rob Anderson
Hi,

With respect to initializing R state and parsing, you might want to look at
the Linking GUI's and other front-ends to R section in Writing R
Extensions http://cran.r-project.org/doc/manuals/R-exts.pdf.

Once the initialization is done, you can use mkString() function to get an
input SEXP from a C character buffer(your R code). Calling R_ParseVector()
with this SEXP as input will give you the parsed output. It works for me.

Thanks,
Rob

On Tue, Nov 8, 2011 at 6:53 PM, KR krunal.ra...@gmail.com wrote:

 Simon Urbanek simon.urbanek at r-project.org writes:
  Except that you don't know what are macros, inlined functions and actual
 functions. If you are careful you
  can possibly fall back to external functions but, obviously, your code
 will be
 less efficient. I would
  still prefer including Rinternals.h - you must have a *really* good
 reason to
 not do so ;)

 Hmmm yes there are good motives (I am not completely unreasonable, yet :P)
 but I
 could probably cope with it if there is no other way.

 Regarding the rest of the e-mail, please let me be clearer on what my goal
 is. I
 would need a function to create and initialize an R state, a function to
 close
 the state, and a function (R_ParseVector?) that takes as input the R state
 and a
 string (containing R code), evaluates the code and return an error code
 (error, incomplete, done) plus (eventually) a string containing the output
 of
 the computation.

 In my application I do not have any UI elements (it's console based), but I
 would like calls to plot in R (and other functions using the graphic
 device) to
 function as they would under R.exe (on windows), i.e. have persistent
 windows
 popped up which you can resize ecc ecc. I naively thought that these
 graphic
 capabilities came automatically with the R_ParseVector via some threading
 techniques.

 Thanks for all your comments!


 Cheers

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


[[alternative HTML version deleted]]

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


Re: [Rd] Accessing ENVSXP and CLOSXP while processing parsed R code

2011-11-08 Thread Rob Anderson
Thanks! that was useful

Rob

On Mon, Nov 7, 2011 at 6:49 AM, Duncan Murdoch murdoch.dun...@gmail.comwrote:

 On 11-11-07 5:24 AM, Rob Anderson wrote:

 Hello Guys,

 Following up my earlier mail where I am trying to write an alternative
 front-end for R,  I had a question about accessing the closures and
 environments in R code.

 Here's the function taken  and modified a little from *Lexical Scope and
 Statistical Computing*


 ==**==**=
 f-function(){
   Rmlfun-function(x){
 sumx-  sum(x)
 n-  length(x)
 function(mu)
   n*log(mu)-mu*sumx
   }
   efun-Rmlfun(1:10)
   y1-  efun(3)
   print(y1)
   efun2-  Rmlfun(20:30)
   y2-  efun2(3)
   print(y2)
 }
 ==**==**=

 Now assignment efun-Rmlfun(1:10) creates a closure where
 *function(mu) n*log(mu)-mu*sumx *is returned and *sumx* and *n *are added
 to the existing environment.


 That's not correct.  When you call Rmlfun, an evaluation frame
 (environment) is created.  It contains the argument x.  Then sumx and n are
 added to it.  Then the anonymous closure is created, with body
 n*log(mu)-mu*sumx, and the closure's environment is the evaluation frame
 from the call to Rmlfun.



 I can parse the code using *PROTECT(e =
 R_ParseVector(tmp,1,status,R_**NilValue));* where tmp is the buffer

 containing the same source. I can walk the resultant parser output and
 build and alternative Abstract syntax tree(AST).

 I would like to include the information about closure/environments in my
 AST so that I can possibly do some optimizations.


 It's not there, except potentially.  When you call the function function
 to create the closure, that's when the closure is created. That doesn't
 happen at parse time.  Rmlfun is created when you evaluate f() and then the
 anonymous function is created when you call Rmlfun() within it.



 My question is, how can I get hold of this information?

 One thing I noticed while 'walking' through the parser output, I never
 encounter a CLOSXP (which I check using TYPEOF()) , even though in the
 above code, closure is created. Is it the case that this information is
 meant just for the internal eval* function and not exposed application
 writers?


 No, there's nothing hidden, it just didn't exist at the time you were
 looking for it.

 Duncan Murdoch


[[alternative HTML version deleted]]

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


Re: [Rd] Question on parsing R code from C

2011-11-08 Thread Simon Urbanek

On Nov 8, 2011, at 6:53 PM, KR wrote:

 Simon Urbanek simon.urbanek at r-project.org writes:
 Except that you don't know what are macros, inlined functions and actual 
 functions. If you are careful you
 can possibly fall back to external functions but, obviously, your code will 
 be 
 less efficient. I would
 still prefer including Rinternals.h - you must have a *really* good reason 
 to 
 not do so ;)
 
 Hmmm yes there are good motives (I am not completely unreasonable, yet :P) 
 but I 
 could probably cope with it if there is no other way.
 
 Regarding the rest of the e-mail, please let me be clearer on what my goal 
 is. I 
 would need a function to create and initialize an R state, a function to 
 close 
 the state, and a function (R_ParseVector?) that takes as input the R state 
 and a 
 string (containing R code), evaluates the code and return an error code 
 (error, incomplete, done) plus (eventually) a string containing the output of 
 the computation.
 

That itself is quite simple - there is an example in R-ext 5.12.


 In my application I do not have any UI elements (it's console based), but I 
 would like calls to plot in R (and other functions using the graphic device) 
 to 
 function as they would under R.exe (on windows), i.e. have persistent windows 
 popped up which you can resize ecc ecc. I naively thought that these graphic 
 capabilities came automatically with the R_ParseVector via some threading 
 techniques.
 

R_ParseVector doesn't evaluate anything so it's innocent here. Rf_eval() will 
run the actual code and it will create a window (if you use an interactive 
device) but the window won't respond to anything, because the moment Rf_eval() 
returns R has lost control and everything is up to your code. R is not 
threaded* (and the R API is not thread-safe) so the only way to continue is for 
you to run the run loop, i.e. you have to return control back to R so it can 
process events. 

Now the hard part is that running the event loop is system-dependent. You will 
see it discussed in R-ext 8.1 (unix) and 8.2 (Windows).

Cheers,
Simon


* - on unix R itself doesn't use threads because it's problematic (other than 
OpenMP); the Windows Rgui actually uses threads cautiously so that the UI stays 
responsive while R is busy, but this is not done by R but the GUI. Similarly 
R.app GUI uses threads to monitor I/O pipes but the system loop is meshed into 
R.

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