Re: [Rd] how to unbreak a circular package dependence (S4 class data)

2014-01-31 Thread Claudia Beleites
]]
 
 
 
  __
  R-devel@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-devel
 
 
  --
  Hervé Pagès
 
  Program in Computational Biology
  Division of Public Health Sciences
  Fred Hutchinson Cancer Research Center
  1100 Fairview Ave. N, M1-B514
  P.O. Box 19024
  Seattle, WA 98109-1024
 
  E-mail: hpa...@fhcrc.org
  Phone:  (206) 667-5791
  Fax:(206) 667-1319
 
 
  __
  R-devel@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-devel
 
 
   [[alternative HTML version deleted]]
 



-- 
Claudia Beleites, Chemist
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] FOSS licence with BuildVignettes: false

2013-09-20 Thread Claudia Beleites
Hi there,

Am Tue, 17 Sep 2013 09:25:14 +0100
schrieb Prof Brian Ripley rip...@stats.ox.ac.uk:

 On 16/09/2013 15:49, Paul Gilbert wrote:
  On 13-09-16 05:19 AM, Uwe Ligges wrote:
  ...
  Yes, and I could see really rare circumstances where vignette
  building takes a long time and the maintainer decides not to build
  vignettes as part of the daily checks.
  ...

I have two vignettes that I build externally because the
required data sets are largish (20 and 40 MB zipped), so I provide them
for download on hyperSpec's home page but do not want to burden CRAN
with them. Instructions how to get that data to build the vignette
yourself are one of the first points in the vignette. 

I do /not/ have BuildVignettes: FALSE but a Makefile that
turns of pdflatex for these two only, and dummy .Rnw files that provide
just the appropriate \VignetteIndex etc. entries.

IMHO that is a perfectly reasonable option for FOSS packages, and while
it makes it my responsibility to check the vignette building, a
Makefile for preparing the package takes care of that as well. I can
also make sure that both data and real vignette source are available
there.

For an upcoming spectral unmixing package, however, I'd like to include
a vignette dealing with the cuprite AVIRIS data set (remote sensing
data, a standard data set used on many publications for spectral
unmixing) that can be downloaded from the NASA
(http://aviris.jpl.nasa.gov/data/free_data.html).

Is it acceptable to have a vignette that points to yet another data
source (which is out of my control)?

(I think this question goes mainly to Brian and the author of the part
of the manual cited by Ben).

Best,

Claudia




 
  I thought 'BuildVignettes: FALSE' only turns of assembling the pdf,
  all the code is still run.  I don't think that would affect the
  time very much. Am I wrong (again)?
 
 Yes, as the code is run again to re-build the vignettes.
 
 The main use of BuildVignettes: FALSE is when building the vignettes 
 requires unusual facilities -- presumably not R ones as it does not
 turn off running the code.  However, for a FOSS package, the means to 
 re-build the vignettes has to available to others, and CRAN therefore 
 tries it so see if all the sources are available.  Almost every time
 we uncover some problem with the sources and stale vignette PDFs.



-- 
Claudia Beleites, Chemist
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] Contribution

2013-02-12 Thread Claudia Beleites
Hi Parthasarathy,

IMHO the easiest way to contribute to R is contributing to an R
package. And one way to do that is to apply for a Google Summer of Code
project. I guess activities about that will start soon, as the program
was just announced, and they will take place at a separate email list:

gso...@groups.google.com

So I suggest you sign up for that list, and maybe explain a bit who you
are, what experience you have in R programming (or other languages) and
what your programming interests are. 

Best, Claudia




 I am Parthasarathy G , from IIT Maras ( India ). I am currently in
 third year of the undergraduate course.
 
 I would like to contribute to the R project. Can anyone guide me
 regarding this?
 
 Thanking you,
 Parthasarathy
 
   [[alternative HTML version deleted]]
 
 __
 R-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
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


[Rd] as.numeric and as.character with locale using comma as separator

2012-08-14 Thread Claudia Beleites
Dear all,

summary:

My LC_NUMERIC is changed from C to de_DE by library (qtbase).
[which shouldn't happen according to the warning when setting it back
manually].
I posted an issue at their github repository, but maybe the behaviour is
a bit more of general interest.

However, if LC_NUMERIC is changed, as.character () uses the decimal
separator that belongs to LC_NUMERIC (and not options ()$OutDec as I
supposed).
as.double () (= as.numeric ()) doesn't, though.

That causes trouble with constructs like
as.numeric (as.character (x))

long version:

as.character seems to take into account my locale (de_DE) which uses
comma as decimal separator:

 x - rnorm (3)
 x
[1] -0,004238328 -0,919358537 -1,654543297
 as.character(x)
[1] -0,00423832753479965 -0,919358536523751   -1,65454329680873

whereas as.numeric () doesn't:

 as.numeric (as.character(x))
[1] NA NA NA
Warnmeldung:
NAs durch Umwandlung erzeugt

 as.numeric (gsub (,, ., as.character(x)))
[1] -0,004238328 -0,919358537 -1,654543297


I did not see any mention in the help of as.numeric nor as.character of
this.

Note also the output of example (as.character):
 example (as.character)

as.chr form - y ~ a + b + c

as.chr as.character(form)  ## length 3
[1] ~ y a + b + c

as.chr deparse(form)   ## like the input
[1] y ~ a + b + c

as.chr a0 - 11/999  # has a repeating decimal representation

as.chr (a1 - as.character(a0))
[1] 0,011011011011011

as.chr format(a0, digits=16) # shows one more digit
[1] 0,01101101101101101

as.chr a2 - as.numeric(a1)

as.chr a2 - a0   # normally around -1e-17
[1] NA

as.chr as.character(a2)  # normally different from a1
[1] NA

as.chr print(c(a0, a2), digits = 16)
[1] 0,01101101101101101  NA
Warnmeldung:
In eval(expr, envir, enclos) : NAs durch Umwandlung erzeugt

*session info*
 sessionInfo ()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] de_DE.UTF-8

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

other attached packages:
[1] Hmisc_3.9-3  survival_2.36-14 plumbr_0.6.6 cranvas_0.8
[5] maps_2.2-6   scales_0.2.1 qtpaint_0.9.0qtbase_1.0.5
[9] idendro_1.0

loaded via a namespace (and not attached):
 [1] cluster_1.14.2 colorspace_1.1-1   dichromat_1.2-4
 [4] grid_2.15.1labeling_0.1   lattice_0.20-6
 [7] munsell_0.3objectProperties_0.6.5 objectSignals_0.10.2
[10] plyr_1.7.1 RColorBrewer_1.0-5 SearchTrees_0.5.1
[13] stringr_0.6tools_2.15.1   tourr_0.5.2


Note that

 options ()$OutDec
[1] .

In fresh R sessions I have

locale:
 [1] LC_CTYPE=de_DE.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=de_DE.UTF-8LC_COLLATE=de_DE.UTF-8
 [5] LC_MONETARY=de_DE.UTF-8LC_MESSAGES=de_DE.UTF-8
 [7] LC_PAPER=C LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

It seems qtbase is the culprit:

 x
[1] -0.2290188 -0.1884703  0.2507179
 library (qtbase)
 x
[1] -0,2290188 -0,1884703  0,2507179



After setting the numeric locale back to C:
 Sys.setlocale (LC_NUMERIC, C)
[1] C
Warnmeldung:
In Sys.setlocale(LC_NUMERIC, C) :
  das Setzen von 'LC_NUMERIC' kann bewirken, dass R sich komisch benimmt

as.numeric (as.character (x)) works as supposed (also output has decimal
points again)


Best,

Claudia





-- 
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] test suites for packages

2012-05-23 Thread Claudia Beleites
I use svUnit, too.

I put a kind of standard skeleton into my packages that has a
packagename.unittest () function that will run all svUnit tests (if
svUnit is available). This function returns NA if svUnit is not
available, invisible (TRUE) if all tests are passed and  stops
otherwise. Which will cause R CMD check to fail.

My test directory contains one single tests.R file with the two lines:

library (packagename)
packagename.unittest ()


which gives me e.g.:

Running the tests in ‘tests/tests.R’ failed.
Last 13 lines of output:
only logical matrix subscripts are allowed in replacement

  * : ...) ... **ERROR**
  Error in `[-.data.frame`(`*tmp*`, x.na, value = NA) :
only logical matrix subscripts are allowed in replacement
   kind timingtime unit msg
  test(kernelpls.fit)OK  0.009 2012-05-23 14:38:49
  test(scale)OK  0.009 2012-05-23 14:38:49
  test(.ldapreproc)   **ERROR**  0.007 2012-05-23 14:38:49
  test(pcalda)   OK  0.003 2012-05-23 14:38:49
  Error in errorLog(summarize = FALSE) : 0 failure(s) and 1 error(s)
  Calls: cbmodels.unittest - errorLog
  Execution halted


While the 13 lines may not be enough if there are lots of tests, I can
easily run packagename.unittest () in an interactive session and start
tracking down the problem from there.


Claudia


Am 18.05.2012 17:28, schrieb Cook, Malcolm:
 svUnit - is Runit compatible and provides some  IDE integration and report
 generation and easy syntax for defining tests.
 
 I find it works a treat, and fits very nicely with my R coding/packaging
 style (which also uses inlinedocs for easy package creation).
 
 --Malcolm Cook
 
 
 On 5/17/12 9:10 AM, Whit Armstrong armstrong.w...@gmail.com wrote:
 
 Can anyone share some opinions on test suites for R packages?

 I'm looking at testthat and RUnit. Does anyone have strong opinions on
 either of those.

 Any additional packages I should consider?

 Thanks,
 Whit

 __
 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


-- 
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] R datasets ownership(copyright) and license

2012-04-03 Thread Claudia Beleites
Yaroslav,

coming from an experimental field, I use options 4 and 4a:

4. I measure the data myself, so I am the copyright holder.
4a. I publish data sets that are given to me in order to publish by the
person(s) who did the measurement. This is properly annotated in the
authors field.

So far, the data sets I put as example data into packages are small
subsets of real studies or data collected in pre-tests, so they are not
that sensitive/valuable. I plan to publish at least one real data set
(as own package) eventually. But we're not yet there.

Claudia




Am 03.04.2012 00:06, schrieb Yaroslav Halchenko:
 Dear R Developers,
 
 Recently filed (and dismissed ;) ) law suit by Astrolabe against tz
 database developers caused a lot of media-press and discussions and
 created some kind of precedence in the USA [3].  But also it imho showed
 that similar attacks might happen in the future, and possibly against
 data sets which are not that obviously factual thus after all might
 fall under copyright or IP protection if not in the states then in
 some other jurisdictions.
 
 And 'data copyright/license' question comes over and over again, I just
 wanted to ask based on  what policies or advisories datasets were
 selected to be shipped with R.   From a very very brief look at the
 datasets, many of them appear to be factual data, thus at least at the
 moment probably are not copyrightable in the states -- but is there
 guarantee that they are not protected by copyright elsewhere if their
 origin abroad?   But some seems to come from published works (still)
 under copyright with All rights reserved, e.g. datasets Harman23
 and Harman74 [4].
 
 Although similar question to mine was raised before [e.g. 1,2] I
 have not found a straight answer e.g. from a list above or a mix of
 them:
 
 1. we simply did not look into it and adopted them with idea that if
someone complains -- we remove corresponding pieces
 
 2. we considered all datasets factual data thus not copyrightable (in
USA? around the globe?)
 
 3. for each (or some or majority) dataset we did collected information
on possible copyright+license/IP holder and contacted them where
unclear about the permission for reuse in a project under GPL license
 
 Thank you in advance for the clarification!
 
 P.S. Please do not take me wrong -- I am not trying to pick at
 anyone.  I just wanted to get a better sense on the
 procedures/assumptions R developers use while adopting data for the R
 package, so that it could be of help for other projects.
 
 [1] https://stat.ethz.ch/pipermail/r-help/2007-April/130422.html
 [2] http://www.mail-archive.com/r-help@r-project.org/msg62486.html
 [3] http://en.wikipedia.org/wiki/Tz_database
 [4] it is interesting there that actual data comes from unpublished PhD
 thesis, but once again from the U of Chicago who holds copyright
 for the book itself.
 


-- 
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] CRAN policies

2012-03-30 Thread Claudia Beleites
Paul,

 One of the things I have noticed with the R 2.15.0 RC and --as-cran is 
 that the I have to bump the version number of the working copy of my 
[snip]
 
 I am curious how other developers approach this.

Regardless of --as-cran I find it very useful to use the date as minor
part of the version number (e.g. hyperSpec 0.98-20120320), which I set
automatically.

Claudia





-- 
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] Command completion of the R binary / Ubuntu

2012-01-12 Thread Claudia Beleites
Am 11.01.2012 19:53, schrieb Sharpie:
 The bash completion script is also used by the Homebrew package manager on
 OS X.
There we go... good to know.


-- 
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


[Rd] Command completion of the R binary / Ubuntu

2012-01-11 Thread Claudia Beleites
Dear Deepayan and dear list,

I notice a small inconsistency with the command completion of the R CMD
check. --no-latex is deprecated sincs R 2.12.0 and defunct since 2.13.0
but the command line completion still suggests it:

cb@cbdesktop:~/r-devel$ bin/R CMD check --no-here I hit tab
--no-clean  --no-examples   --no-latex  --no-vignettes
--no-codoc  --no-install--no-tests
cb@cbdesktop:~/r-devel$ bin/R CMD check --no-latex
Fehler: '--no-latex' is defunct: use '--no-manual' instead

I gather the command line options could be updated to current R CMD
check in file /etc/bash_completion.d/R:

cb@cbdesktop:~/tmp$ diff R /etc/bash_completion.d/R
244,247c244,245
   --no-install --no-tests --no-vignettes --no-manual \
   --no-rebuild-vignettes --install-args  --check-subdirs \
   --extra-arch --multiarch --no-multiarch --force-multiarch \
   --timings  --use-gct --use-valgrind --rcfile
---
   --no-install --no-tests --no-vignettes --no-latex \
   --use-gct --use-valgrind --rcfile

I gather from the mailing list archives, that the original is available at
http://code.google.com/p/rcompletion/source/browse/trunk/bash_completion/R

Should I suggest the patch there? Will changes propagate to the packaged
linux distributions from there or should the updated file be brought to
the attention somewhere else?

Best regards,

Claudia







 sessionInfo ()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=de_DE.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=de_DE.UTF-8LC_COLLATE=de_DE.UTF-8
 [5] LC_MONETARY=de_DE.UTF-8LC_MESSAGES=de_DE.UTF-8
 [7] LC_PAPER=C LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

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

-- 
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




244,247c244,245
 		--no-install --no-tests --no-vignettes --no-manual \
   --no-rebuild-vignettes --install-args  --check-subdirs \
   --extra-arch --multiarch --no-multiarch --force-multiarch \
 		--timings  --use-gct --use-valgrind --rcfile
---
 		--no-install --no-tests --no-vignettes --no-latex \
 		--use-gct --use-valgrind --rcfile
__
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] Data package questions

2011-06-10 Thread Claudia Beleites

Dear Paul,


In process of creating data package from an existing one.
The current package has both raw data files and the associated
RData objects created from them. Currently, the data subdirectory
is 1.5Mb and the extdata is 5.4Mb.

Never having created a data package before, how is this best
done? Should the data package contain only the raw data, or
the RData objects too (tightly coupled)? If the later, what
(if anything) is added to the DESCRIPTION meta-information
to denote the dependency? Should both packages suggest each
other?


I have one data set that I ship as a few principal components and 
reconstruct it by a function. The result is then assigned to the 
exported variable by delayedAssign.


That way, you'd need to ship the raw data only, but can provide a 
ready-to-use R object as well.


For my example data, I don't ship the raw data as it is too big (30 MB 
toy example is really unpolite on CRAN), but I provide it at r-forge and 
give the link on the help page and in the vignette.


Claudia

--
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


[Rd] logos

2011-04-01 Thread Claudia Beleites

Dear all,

I'd like to link one of the logos in our Google Summer of Code Profile. 
If I remember correctly, behind the logo link at 
http://developer.r-project.org/ (i.e. 
http://developer.r-project.org/Logo) also small versions can be found. 
However, I'm not allowed to access that directory.
I have no problem with putting a small version of the normal logo 
somewhere online, but I'm wondering whether the logo directory really 
isn't supposed to be accessed by the public.


Thanks,

Claudia

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


Re: [Rd] Sweave: multiple graphic formats, e.g. win.metafile

2011-03-23 Thread Claudia Beleites

On 03/23/2011 01:05 PM, Prof Brian Ripley wrote:

We are currently in the process of implementing PNG and JPEG for 2.13.0, and an
extensible architecture is planned for 2.14.0.

:-) this is really good news :-)


Thank you!


--
Claudia Beleites
DI3
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] X error on r-forge

2011-02-22 Thread Claudia Beleites

Dear all,

since a few days, my package hyperSpec does not build on r-forge. I have no idea 
whether this is due to my code or whether something is wrong with r-forge.

It fails with an X server error:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  73 (X_GetImage)
  Serial number of failed request:  806
  Current serial number in output stream:  806

My guesstimate from the other output 
(http://r-forge.r-project.org/R/?group_id=366log=build_srcpkg=hyperSpecflavor=patched) 
is that it happens in the plotting vignette where I demonstrate plotting with 
rgl and try to save the image as png.

It used to work, and the package builds and checks on my computer with both
R version 2.12.1 (2010-12-16) Platform: x86_64-pc-linux-gnu (64-bit) and the 
current r-devel as well as on winbuilder.


Any ideas?

Thanks a lot,

Claudia


--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] vignette question was: CRAN package sizes

2011-02-15 Thread Claudia Beleites
Also I started doing my homework with regards to package size, and that is 
mainly cleaning leftovers from vignette generation and compressing the pdfs.


For most of my vignettes, ghostscript (lossy) compression works very well:
I use the /screen settings and -dDownsampleColorImages=false
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE 
-dQUIET -dBATCH -dDownsampleColorImages=false -dAutoRotatePages=/None
(DownsampleColorImages=false is important as I found otherwise that some .png 
become completely useless. However, the pngs are saved with carefully determined 
size and are pngs because the pdfs were too large: so I know that the bitmap 
images are already size-optimized)
I wrote a inst/doc/makefile to do this and also clean up a few more leftovers 
from the vignette.


BTW: while compressing the final .pdf achieves better total compression, it 
already helps a lot to compress the .pdf figures which can be done at the end of 
the .Rnw.


qpdf didn't help for my vignettes.


One question remains, though. I have two vignettes, where I cannot put the 
original data into the package (the very first thing in the vignette is the link 
to a zip file on r-forge that contains everything needed to reproduce the 
vignette, though. I think this is accessible enough for FOSS).
I'd like to have these documents accessible via the usual vignette () mechanism 
(this question has come up before, but I found only that the 00Index.dcf does 
not work any longer).
My second thought was to set up the Makefile so that instead of building the pdf 
a message is printed and the available pdf is used.
This does not work, however: buildVignettes (which I guess does the work*) first 
Sweaves the .Rnw file and then replaces the texi2dvi () call by make.
Is this intended behaviour? If so, how do I make my vignette accessible 
[obviously the dummy .Rnw that includes the pdf-technique doesn't look quite 
appropriate as it leads to unnecessarily large package size]?


*I did not realise this from the Makefile discussion in the extensions manual 
(nor does the help page of buildVignettes mention anything about this). Also, 
I'd appreciate very much if the extension manual would mention buildVignettes - 
it took me quite a while to find out what code is used and why my Makefile 
didn't lead to the desired results.


Thanks a lot for any ideas,

Claudia

--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] vignette question was: CRAN package sizes

2011-02-15 Thread Claudia Beleites

Please excuse the noise about dummy .Rnw.

On 02/15/2011 03:44 PM, Claudia Beleites wrote:

Also I started doing my homework with regards to package size, and that is
mainly cleaning leftovers from vignette generation and compressing the pdfs.

For most of my vignettes, ghostscript (lossy) compression works very well:
I use the /screen settings and -dDownsampleColorImages=false
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE
-dQUIET -dBATCH -dDownsampleColorImages=false -dAutoRotatePages=/None
(DownsampleColorImages=false is important as I found otherwise that some .png
become completely useless. However, the pngs are saved with carefully determined
size and are pngs because the pdfs were too large: so I know that the bitmap
images are already size-optimized)
I wrote a inst/doc/makefile to do this and also clean up a few more leftovers
from the vignette.

BTW: while compressing the final .pdf achieves better total compression, it
already helps a lot to compress the .pdf figures which can be done at the end of
the .Rnw.

qpdf didn't help for my vignettes.




One question remains, though. I have two vignettes, where I cannot put the
original data into the package (the very first thing in the vignette is the link
to a zip file on r-forge that contains everything needed to reproduce the
vignette, though. I think this is accessible enough for FOSS).
I'd like to have these documents accessible via the usual vignette () mechanism
(this question has come up before, but I found only that the 00Index.dcf does
not work any longer).
My second thought was to set up the Makefile so that instead of building the pdf
a message is printed and the available pdf is used.
This does not work, however: buildVignettes (which I guess does the work*) first
Sweaves the .Rnw file and then replaces the texi2dvi () call by make.
Is this intended behaviour? If so, how do I make my vignette accessible
[obviously the dummy .Rnw that includes the pdf-technique doesn't look quite
appropriate as it leads to unnecessarily large package size]?
coffe break was helpful: of course I just need a dummy .Rnw that is processed to 
a .tex but (via Makefile) _not_ to pdf...



*I did not realise this from the Makefile discussion in the extensions manual
(nor does the help page of buildVignettes mention anything about this). Also,
I'd appreciate very much if the extension manual would mention buildVignettes -
it took me quite a while to find out what code is used and why my Makefile
didn't lead to the desired results.


Sorry, Claudia



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] drop argument for apply, rowSums, etc.

2011-02-14 Thread Claudia Beleites

Dear list, dear Henrik,

I find myself often reconstructing matrices from the result of rowSum (matrix) 
etc. I therefore propose a new argument, drop, for these functions:


drop = TRUE (default) is the current behaviour. With
drop = FALSE length (dim (x)) and dimnames are preserved and the affected 
dimensions are set to 1 (or whatever teh result length of the applied function is)


I modified the base functions in colSums.R accordingly, and provide the 
respective methods (I did not yet have the time to look into apply.R).


I'm wondering whether these changes are of sufficient interest to the R public 
that these methods should have a more obvious home than a spectroscopy 
package. As I learned this morning of package matrixStats: Henrik, would you 
like to include these modified functions?


Anyways, the code is in the attached file, so if someone needs the funcionality, 
he can find it here.


Claudia












--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it
#  From base/R/colSums.R

.colSums - function(x, na.rm = FALSE, dims = 1L, drop = TRUE)
{
if(is.data.frame(x)) x - as.matrix(x)
if(!is.array(x) || length(dn - dim(x))  2L)
stop('x' must be an array of at least two dimensions)
if(dims  1L || dims  length(dn) - 1L)
stop(invalid 'dims')
n - prod(dn[1L:dims])

dn [1L : dims] - 1L

z - if(is.complex(x))
.Internal(colSums(Re(x), n, prod(dn), na.rm)) +
1i * .Internal(colSums(Im(x), n, prod(dn), na.rm))
else .Internal(colSums(x, n, prod(dn), na.rm))

if (drop){
  if(length(dn)  dims + 1L) {
dim(z) - dn[-(1L:dims)]   
dimnames(z) - dimnames(x)[-(1L:dims)]
  } else names(z) - dimnames(x)[[dims+1]]
} else {
  dim(z) - dn
  dimnames(z) - dimnames(x)
}
z
}

.colMeans - function(x, na.rm = FALSE, dims = 1L, drop = TRUE)
{
if(is.data.frame(x)) x - as.matrix(x)
if(!is.array(x) || length(dn - dim(x))  2L)
stop('x' must be an array of at least two dimensions)
if(dims  1L || dims  length(dn) - 1L)
stop(invalid 'dims')
n - prod(dn[1L:dims])
dn [1L : dims] - 1L
z - if(is.complex(x))
.Internal(colMeans(Re(x), n, prod(dn), na.rm)) +
1i * .Internal(colMeans(Im(x), n, prod(dn), na.rm))
else .Internal(colMeans(x, n, prod(dn), na.rm))

if (drop){
  if(length(dn)  dims + 1L) {
dim(z) - dn[-(1L:dims)]   
dimnames(z) - dimnames(x)[-(1L:dims)]
  } else names(z) - dimnames(x)[[dims+1]]
} else {
  dim(z) - dn
  dimnames(z) - dimnames(x)
}
z
}

.rowSums - function(x, na.rm = FALSE, dims = 1L, drop = TRUE)
{
if(is.data.frame(x)) x - as.matrix(x)
if(!is.array(x) || length(dn - dim(x))  2L)
stop('x' must be an array of at least two dimensions)
if(dims  1L || dims  length(dn) - 1L)
stop(invalid 'dims')
p - prod(dn[-(1L:dims)])

dn [(dims + 1L) : length (dn)] - 1L

z - if(is.complex(x))
.Internal(rowSums(Re(x), prod(dn), p, na.rm)) +
1i * .Internal(rowSums(Im(x), prod(dn), p, na.rm))
else .Internal(rowSums(x, prod(dn), p, na.rm))

if (drop){
  if(dims  1L) {
dim(z) - dn [1L:dims]
dimnames(z) - dimnames(x)[1L:dims]
} else  names(z) - dimnames(x)[[1L]]
} else {
  dim(z) - dn
  dimnames(z) - dimnames(x)
}
z
}

.rowMeans - function(x, na.rm = FALSE, dims = 1L, drop = TRUE)
{
if(is.data.frame(x)) x - as.matrix(x)
if(!is.array(x) || length(dn - dim(x))  2L)
stop('x' must be an array of at least two dimensions)
if(dims  1L || dims  length(dn) - 1L)
stop(invalid 'dims')
p - prod(dn[-(1L:dims)])

dn [(dims + 1L) : length (dn)] - 1L

z - if(is.complex(x))
.Internal(rowMeans(Re(x), prod(dn), p, na.rm)) +
1i * .Internal(rowMeans(Im(x), prod(dn), p, na.rm))
else .Internal(rowMeans(x, prod(dn), p, na.rm))

if (drop){
  if(dims  1L) {
dim(z) - dn [1L:dims]
dimnames(z) - dimnames(x)[1L:dims]
} else  names(z) - dimnames(x)[[1L]]
} else {
  dim(z) - dn
  dimnames(z) - dimnames(x)
}
z
}

test (.rowSums) - function (){
  a - array (1:24, 4:2)
  for (d in 1 : 2){
default - base::rowSums (a, dims = d)
drop - rowSums (a, dims = d, drop = TRUE)
nodrop - rowSums (a, dims = d, drop = FALSE)

checkEquals (default, drop, sprintf (base version ./. drop = TRUE, dim = 
%i, d))
checkEquals (c (default), c (nodrop), sprintf (drop = TRUE ./. FALSE, dim 
= %i, d))

dd - dim (default)
if (is.null (dd)) dd - length (default)
checkEquals (dim (nodrop) [1 : d], dd, sprintf (result dimensions, d = 
%i, d))
  }
}

test (.rowMeans) - function (){
  a - array (1:24, 4:2)
  for (d in 1 : 2){
default - base::rowMeans (a, dims = d)
drop

Re: [Rd] dependencies on system packages

2011-02-04 Thread Claudia Beleites

Dear all,

From the writing extensions manual:
Other dependencies (external to the R system) should be listed in the 
‘SystemRequirements’ field, possibly amplified in a separate README file.


I guess one problem is the user may not realize that the -dev version is 
needed, and just sees libxml2 installed but the R package installation 
stopping with the respective error.


Giving the package name for specific distributions is of course polite 
(if the developer knows it). As developer you may also put into the 
README that the package's mailing list/forum/wiki/... contains 
information and ask the user to enter the package name on his distro if 
it is not already there.



my 2 ct

Claudia



Am 04.02.2011 04:48, schrieb Simon Urbanek:

Jeroen,

On Feb 3, 2011, at 9:31 PM, Jeroen Ooms wrote:



Many R packages depend on some unix libraries that are not part of most
default installations. I often spend a significant amount of time figuring
out where to get the appropriate libraries for compiling these packages,
after they give some vague error of something missing. I was wondering why
there is no formal system of specifying non-R dependencies in the
DESCRIPTION file. If this would be the case, then during the installation of
an R package, the user could be prompted to install required system packages
(if they have appropriate privileges).

So for example:

Package: XML
Version: 3.2-0
Depends: R (= 1.2.0), methods, utils
Depends-debian: libxml2-dev
Depends-ubuntu: libxml2-dev
Depends-redhat: libxml2-devel
Depends-suse: libxml2-devel
etc.

This might make life for many people just a little easier. If they are root
and the package is in their system repositories, than it will install
automatically. If not, at least they know for which package to look, or
request their sys admin to install.


Well, there is already such system in place and it is the corresponding 
descriptions in the distributions. Obviously as an author of the package I 
don't care what any particular Linux distribution uses as a name for the needed 
dependencies as the corresponding chaos is distribution-specific. The only 
person who can reasonably determine the dependencies is the maintainer of the 
distribution and that's what they do and as a user of the above mentioned 
distributions you should be thankful to them. Fortunately, normal users don't 
have to worry about it as major distributions already come with a large set of 
R packages resolving all dependencies. Hence I don't see any reason why this 
should have anything to do with the DESCRIPTION file. The improvements I could 
think of would be a parseable entry or a canonical pointer to dependency 
sources, but that's a whole another story.

Cheers,
Simon

__
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] Google Summer of Code 2011

2011-01-27 Thread Claudia Beleites

Dear all,

I just saw that Google Summer of Code 2011 is announced:
http://www.google-melange.com/

Claudia

--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] plotmath indices: suggested addition to help file

2011-01-21 Thread Claudia Beleites

Dear all,

after realizing yesterday that my suggestion was not yet quite ripe as the 
character version is very limited, I decided to wait a bit before summarizing 
the outcome to a better proposition instead of creating too much fuss.


Martin, thanks for your support  systematic table :-)

My main point is that somehow I didn't at all expect plotmath to throw away 
everything after the i of expression (x [i,j]). I think this trap deserves 
either change (nice to have; I now believe that this may be quite easy, see 
below) or at least an announcement.


I agree that one needs to learn dealing with plotmath. On the other hand, it is 
nice if plotmath's output corresponds to the R meaning of the expression.


I guess the underlying problem is that we have three different possibilities 
with indexing:


 R --- how I'd write down the R meaning
(a)   x [i, j]  --- x_{i, j} or x_{i j} (not x_{ij})
(b)   x [i [j]] --- x_i_j
(c)   x [i][j]  --- (x_i)_j

(b) works as expected, though a tiny little bit more default space would be 
excellent.

(a) produces plotmath output x_i which is _very_ unexpected, and
(c) produces output that looks very similar to my expectation for (a) and can 
thus be used to cheat around unexpected behaviour of (a).

I'd say the behaviour of (c) is fine, and it is up to me to write (x [i])[j].
Note that writing (x [i]) [j] does not change the R meaning of the expression.

BTW: I prefer a comma for (a) because i couldn't distinguish the output of
expression (x [i][j])
from
expression (x [ij])
.
I also vote for a comma for the future behaviour of (a) - even with some space 
it's easier to distinguish two indices if they are separated by a comma (and no 
comma can still be obtained by x[i][j]). Plus, it may be easier to implement it 
that way.


I tried:
CDDR instead CADDR in RenderSub (plotmath.c) yields all indices given in the 
square bracket. Now I prepended install (list) by LCONS, and it seems to work:

plot (1,1, type = n); text (1, 1, expression (x [i[a,b,c],j,k]*f(x)), cex = 3)
now looks as I expect.

Disclaimer: This is the first time ever I tried to do something with the R C 
interface, and I didn't even properly read the maual and SoDa chapters. So I 
have no idea whether I did something that will cause trouble.


Best regards  have a nice weekend

Claudia

cb@cb:~/r-devel$ svn diff src/main/plotmath.c
Index: src/main/plotmath.c
===
--- src/main/plotmath.c (revision 54062)
+++ src/main/plotmath.c (working copy)
@@ -898,6 +898,7 @@
mathContext*, pGEcontext , pGEDevDesc);
 static BBOX RenderExpression(SEXP, int, mathContext*, pGEcontext , pGEDevDesc);
 static BBOX RenderSymbolChar(int, int, mathContext*, pGEcontext , pGEDevDesc);
+static BBOX RenderCommaList(SEXP, int, mathContext *, pGEcontext, pGEDevDesc);


 /*  Code to Generate Bounding Boxes and Draw Formulae. */
@@ -1396,7 +1397,8 @@
 {
 BBOX bodyBBox, subBBox;
 SEXP body = CADR(expr);
-SEXP sub = CADDR(expr);
+SEXP sub = CDDR(expr);
+SEXP list = install (list);
 STYLE style = GetStyle(mc);
 double savedX = mc-CurrentX;
 double savedY = mc-CurrentY;
@@ -1407,6 +1409,7 @@
 s5 = TeX(sigma5, gc, dd);
 s16 = TeX(sigma16, gc, dd);
 SetSubStyle(style, mc, gc);
+sub = LCONS (list, sub);
 subBBox = RenderElement(sub, 0, mc, gc, dd);
 v = max(max(v, s16), bboxHeight(subBBox) - 0.8 * sigma5);
 subBBox = RenderOffsetElement(sub, 0, -v, draw, mc, gc, dd);

--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] plotmath indices: suggested addition to help file

2011-01-20 Thread Claudia Beleites

Dear all,

I just stumbled over the fact that subsetting by square bracket will only output 
the first given index. I guess the rest is thrown away by the CADDR in RenderSub 
(plotmath.c l. 1399).
Maybe changing this could be considered as low-priority desired (would be nice 
if the output works for ?


However, I suggest to announce the fact that only the first parameter is printed 
in plotmath.Rd.


E.g. in the table l. 72
\code{x[i]}   \tab x subscript i; escape further indices (\code{x [i, j]})\cr

Claudia

--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] R vs. C now rather: how to ease package checking

2011-01-18 Thread Claudia Beleites




La version fran�aise suit le texte anglais.





This email may contain privileged and/or confidential information, and
the
Bank of
Canada does not waive any related rights. Any distribution, use, or
copying of this
email or the information it contains by other than the intended
recipient
is
unauthorized. If you received this email in error please delete it
immediately from
your system and notify the sender promptly by email that you have done
so.





Le pr�sent courriel peut contenir de l'information privil�gi�e ou
confidentielle.
La Banque du Canada ne renonce pas aux droits qui s'y rapportent. Toute
diffusion,
utilisation ou copie de ce courriel ou des renseignements qu'il contient
par une
personne autre que le ou les destinataires d�sign�s est interdite. Si
vous
recevez
ce courriel par erreur, veuillez le supprimer imm�diatement et envoyer
sans d�lai �
l'exp�diteur un message �lectronique pour l'aviser que vous avez �limin�
de votre
ordinateur toute copie du courriel re�u.





[[alternative HTML version deleted]]




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



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] R vs. C

2011-01-18 Thread Claudia Beleites
 from R to C.

But, then again, I am working with scientists who are not
primarily, or
even
secondarily, coders...

Dave H



This makes sense, but I have seem some very transparent algorithms
turned
into vectorized R code
that is difficult to read (and thus to maintain or to change). These
chunks
of optimized R code are like
embedded assembly, in the sense that nobody is likely to want to mess
with
it. This could be addressed
by including pseudo code for the original (more transparent)
algorithm as a
comment, but I have never
seen this done in practice (perhaps it could be enforced by R CMD
check?!).

On the other hand, in principle a well-documented piece of C/C++ code
could
be much easier to understand,
without paying a performance penalty...but coders are not likely to
place
this high on their
list of priorities.

The bottom like is that R is an adaptor (glue) language like Lisp that
makes it easy to mix and
match functions (using classes and generic functions), many of which are
written in C (or C++
or Fortran) for performance reasons. Like any object-based system
there can
be a lot of
object copying, and like any functional programming system, there can
be a
lot of function
calls, resulting in poor performance for some applications.

If you can vectorize your R code then you have effectively found a
way to
benefit from
somebody else's C code, thus saving yourself some time. For
operations other
than pure
vector calculations you will have to do the C/C++ programming
yourself (or
call a library
that somebody else has written).

Dominick




- Original Message 
From: Dirk Eddelbuettele...@debian.org
To: Patrick Leyshockngkbr...@gmail.com
Cc: r-devel@r-project.org
Sent: Mon, January 17, 2011 10:13:36 AM
Subject: Re: [Rd] R vs. C


On 17 January 2011 at 09:13, Patrick Leyshock wrote:
| A question, please about development of R packages:
|
| Are there any guidelines or best practices for deciding when and
why to
| implement an operation in R, vs. implementing it in C? The
Writing R
| Extensions recommends working in interpreted R code . . . this is
normally
| the best option. But we do write C-functions and access them in R -
the
| question is, when/why is this justified, and when/why is it NOT
justified?
|
| While I have identified helpful documents on R coding standards,
I have
not
| seen notes/discussions on when/why to implement in R, vs. when to
implement
| in C.

The (still fairly recent) book 'Software for Data Analysis:
Programming
with
R' by John Chambers (Springer, 2008) has a lot to say about this. John
also
gave a talk in November which stressed 'multilanguage' approaches; see
e.g.

http://blog.revolutionanalytics.com/2010/11/john-chambers-on-r-and-multilingualism.html




In short, it all depends, and it is unlikely that you will get a
coherent
answer that is valid for all circumstances. We all love R for how
expressive
and powerful it is, yet there are times when something else is
called for.
Exactly when that time is depends on a great many things and you
have not
mentioned a single metric in your question. So I'd start with John's
book.

Hope this helps, Dirk


__
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




La version française suit le texte anglais.





This email may contain privileged and/or confidential ...{{dropped:25}}


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





--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] Vignette Questions

2010-11-16 Thread Claudia Beleites

Dear List,

I recently stumbled over the possibility and need to specifiy
% \VignetteDepends{}
in my vignettes. I did not know about this, and I notice that it is not 
mentioned in the R-extensions manual section Writing package vignettes.


I have some questions with regards to that:

- would it be possible to include into the section Writing package 
vignettes some hint that besides \VignetteIndexEntry also

\VignetteDepends{}
\VignetteKeywords{}
\VignettePackage{}
exist (and should be used)?
Also a link to the R-News Paper Sweave, Part II: Package Vignettes may 
be very helpful.


- Is the documentation of these somewhere else where I didn't find it?

- Are there more such commands?

- Is there a way to ask R CMD check to check whether all dependencies of 
the vignettes are correctly specified?

Of course, on my computer all required packages are available...

- Which dependencies should go into \VignetteDepends{}?
Only those without Priority in the packageDescription, or also 
recommended packages, or maybe even base packages?

Should I specify the package that the vignette belongs to itself?

- Related, but slightly different: is there a way to temporarily enforce 
that specified packages should not be loaded (or that only specified 
packages are allowed to be loaded)?
I have a few functions in my package that do use e.g. plotrix if it is 
available but otherwise should work in a less fancy way.
Till now I test them on an old computer where I didn't install those 
packages but that's quite a hassle.


Thank you very much for your kind help!

Claudia Beleites

--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Valerio 2
I-34127 Trieste
ITALY

email: cbelei...@units.it
phone: +39 (0 40) 5 58-34 68

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


Re: [Rd] SweaveInput + keep.source = TRUE trouble

2010-10-06 Thread Claudia Beleites

Thank you - works fine for me now.

Claudia

Duncan Murdoch wrote:
 This is fixed now in R-devel and the beta version.  The fix isn't 
perfect:  if you use \SweaveInput, you lose the error reporting that 
gives line numbers from the original file.  It should be possible to 
have both, but I think the changes to implement that are too large to 
consider in a beta.


Duncan Murdoch

On 05/10/2010 5:38 AM, Claudia Beleites wrote:

Dear all,

I have trouble with R-beta sweaving files that include definitions with
\SweaveInput in combination with keep.source = TRUE

Symptom:
SInput is taken from too far down the input file (the shift is the 
number of
lines of the included file). Is that known? Searching didn't turn up 
anything,

yet I think there are more people than just me using keep.source.

Example:
$ ~/tmp/R-beta/bin/R CMD Sweave baseline.Rnw
mv baseline.tex baseline.devel.tex
R CMD Sweave baseline.Rnw
mv baseline.tex baseline.2.11.tex
diff -u baseline.2.11.tex baseline.devel.tex

gives:
--- baseline.2.11.tex2010-10-05 11:33:49.0 +0200
+++ baseline.devel.tex2010-10-05 11:33:49.0 +0200
@@ -83,7 +83,7 @@
   \verb+\SweaveOpts{keep.source = TRUE}+
   \begin{Schunk}
   \begin{Sinput}
-  12
+  line 54
   \end{Sinput}
   \begin{Soutput}
   [1] 12
@@ -106,7 +106,7 @@
   line 63 chunk option keep.source = TRUE
   \begin{Schunk}
   \begin{Sinput}
-  14
+  line 67
   \end{Sinput}
   \begin{Soutput}
   [1] 14

I used yesterday's R-beta, and my system is Ubuntu 9.10 64 bit (though 
that

probably doesn't matter).

Building the example file I also found that \SweaveInput{} cannot be 
followed by

anything else on the line(not even a LaTeX comment).

\SweaveInput{x}y
complains that file xy is not found.

Best regards,

Claudia Beleites



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





--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] SweaveInput + keep.source = TRUE trouble

2010-10-05 Thread Claudia Beleites

Sorry, I forgot the sessionInfos:

devel:
R version 2.12.0 beta (2010-10-03 r53154)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

2.11:
R version 2.11.1 (2010-05-31)
x86_64-pc-linux-gnu

locale:
 [1] LC_CTYPE=en_US.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=C  LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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


Claudia Beleites wrote:

Dear all,

I have trouble with R-beta sweaving files that include definitions with
\SweaveInput in combination with keep.source = TRUE

Symptom:
SInput is taken from too far down the input file (the shift is the 
number of
lines of the included file). Is that known? Searching didn't turn up 
anything, yet I think there are more people than just me using keep.source.


Example:
$ ~/tmp/R-beta/bin/R CMD Sweave baseline.Rnw 
mv baseline.tex baseline.devel.tex 
R CMD Sweave baseline.Rnw 
mv baseline.tex baseline.2.11.tex 
diff -u baseline.2.11.tex baseline.devel.tex

gives:
--- baseline.2.11.tex2010-10-05 11:33:49.0 +0200
+++ baseline.devel.tex2010-10-05 11:33:49.0 +0200
@@ -83,7 +83,7 @@
 \verb+\SweaveOpts{keep.source = TRUE}+
 \begin{Schunk}
 \begin{Sinput}
- 12
+ line 54
 \end{Sinput}
 \begin{Soutput}
 [1] 12
@@ -106,7 +106,7 @@
 line 63 chunk option keep.source = TRUE
 \begin{Schunk}
 \begin{Sinput}
- 14
+ line 67
 \end{Sinput}
 \begin{Soutput}
 [1] 14

I used yesterday's R-beta, and my system is Ubuntu 9.10 64 bit (though 
that probably doesn't matter).


Building the example file I also found that \SweaveInput{} cannot be 
followed by anything else on the line(not even a LaTeX comment).


\SweaveInput{x}y
complains that file xy is not found.

Best regards,

Claudia Beleites




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



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] Does anyone use Sweave (RweaveLatex) option expand=FALSE?

2010-08-19 Thread Claudia Beleites

I never used it.

I got curious, though. What would be a situation that benefits of this option?

Maybe a use case could be found by brute force (grep all .Rnw files on CRAN 
for the option?


Claudia

--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] [R] cacheSweave / pgfSweave driver for package vignette

2010-08-13 Thread Claudia Beleites


Dear all,

Maybe we should move the discussion to r-devel? So please excuse the 
cross-posting, it is to tell people at r-help where to find the rest of the 
discussion (in case you agree with me).



I've been wondering about that, too.

Gabor, I use fake vignettes along your lines, too.
In order to provide meaningful samples, I have both bulky data and bulky 
calculations (at least too long to have any fun in running R CMD check frequently).


As I do not want to burden my package with lots ( 60 MB) of raw data in various 
file formats, two vignettes do their real work extra (and the source is 
available for separate download).


So for the development work it would be good to have caching for speed-up.
For the testing purposes of R CMD CHECK, however, the whole thing needs to be 
calculated: afaik the caching mechanism checks for changes in the respective 
chunks. Which is great for data-analysis work. However, in a package development 
scenario the changes are rather expected in the package. I suspect that the 
caching cannot check this. Thus a cached vignette does greatly reduce the 
calculation time, but also knocks out part of the testing.
This would be without concern, if the package is well behaved and does its 
testing in the tests and has the vignettes as manuals. I have to admit, though, 
that my package is not (yet) at this point.


So I personally find myself with a shell script that automatically builds all 
vignettes first, transfers some files into the package (the data sets coming 
with the package are constructed in vignettes), and then check and build the 
package.
In the end, this dependency of the package on the results of its vignettes needs 
much more calculation. I'm talking of ca. 10 - 15 min for the whole process 
(i.e. 5 - 7 min for one check cycle). This is awkward for development, but I 
think it's OK for something to be done occasionally on a nightly check on the 
server.


My conclusion is, that a cached Sweave driver should only be specified in 
certain situations. I.e. it would be very helpful for developing to do this at 
home, but I'm afraid it is not the best idea to reduce the work in checking 
the package in general (e.g. during nightly checks).
I also say this because I have been running into trouble with the nighly build 
on r-forge (due to some LaTeX packages that I thought to be fairly standard, 
which they weren't).
Another error I like to produce is to forget adding a new source file to the 
version control. Both cases are only found in checks during the nightly build on 
the server. There may be other mistakes that would be masked by the caching.


Of course, it is also not nice to keep the servers calculating examples for 
hours. I presume, however, that this case is quite rare (compared to situations 
where the regular building and checking is too long for a fluent development 
cycle), and I'd say that in this case Gabor's procedure is OK.


For my work it would be much more helpful, if R CMD CHECK had also positive 
flags (e.g. --tests as abbreviation for --no-codoc --no-examples --no-install 
--no-vignettes --no-latex)


I know hardly anything about make files and never wrote one myself. I think they 
could be helpful here to switch between the development checks and a complete 
build  check. So I'd be very curious to see some make files.


HTH,

Claudia




--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] rbind on data.frame that contains a column that is also a data.frame

2010-08-09 Thread Claudia Beleites

Dear all,

I also use matrices inside data.frames in my (S4) class hyperSpec.
So, yes, it would be great if commands like apply would work as straightforward
as e.g. rbind does on such data.frames.

The problem here seems to me different, though:
Is it possible that the relevant difference between matrices and data.frames is
that the rownames of a matrix do not need to be unique?

m - matrix (1:12, ncol = 3)
rownames (m) - rep (1, 4)
m

df - as.data.frame (m) # seems to work, but:
df # throws error:
Fehler in data.frame(V1 = c(1, 2, 3, 4), V2 = c(5, 6, 7,  :
  duplicate row.names: 1
dimnames (df)

Greetings,

Claudia


Martin Maechler wrote:

Heinz Tuechler tuech...@gmx.at
on Sat, 07 Aug 2010 01:01:24 +0100 writes:


 Also Surv objects are matrices and they share the same problem when 
 rbind-ing data.frames.
 If contained in a data.frame, Surv objects loose their class after 
 rbind and therefore do not more represent Surv objects afterwards.
 Using rbind with Surv objects outside of data.frames shows a similar 
 problem, but not the same column names.
 In conclusion, yes, matrices are common in data.frames, but not 
 without problems.


My understanding ( 20 yr long S and R experience) has been that
a dataframe definitely can have matrix-like components,
and as Bill Dunlap (with equal S  R experience) has just
explained, that's actually more common than you have thought.
To have *data frame*s instead of simple matrices, should be much
less common, I'm not sure if it's a good idea.

But getting back to 'matrices',
I think they should work without problems, at least for basic
R operations such as rbind().

I don't have time to analyze the Surv - example below,
but  at the moment think, that we'd be interested in 
fixing the problems..


Martin Maechler, ETH Zurich

 Heinz

 ## example
 library(survival)
 ## create example data
 starttime - rep(0,5)
 stoptime  - 1:5
 event - c(1,0,1,1,1)
 group - c(1,1,1,2,2)

 ## build Surv object
 survobj - Surv(starttime, stoptime, event)

 ## build data.frame with Surv object
 df.test - data.frame(survobj, group)
 df.test

 ## rbind data.frames
 rbind(df.test, df.test)

 ## rbind Surv objects
 rbind(survobj, survobj)



 At 06.08.2010 09:34 -0700, William Dunlap wrote:
  -Original Message-
  From: r-devel-boun...@r-project.org
  [mailto:r-devel-boun...@r-project.org] On Behalf Of Nicholas
  L Crookston
  Sent: Friday, August 06, 2010 8:35 AM
  To: Michael Lachmann
  Cc: r-devel-boun...@r-project.org; r-devel@r-project.org
  Subject: Re: [Rd] rbind on data.frame that contains a column
  that is also a data.frame
 
  OK...I'll put in my 2 cents worth.
 
  It seems to me that the problem is with this line:
 
  b$a=a , where s is something other than a vector with
  length equal to nrow(b).
 
  I had no idea that a dataframe could hold a dataframe. It is not just
  rbind(b,b) that fails, apply(b,1,sum) fails and so does plot(b). I'll
  bet other R commands fail as well.
 
  My point of view is that a dataframe is a list of vectors
  of equal length and various types (this is not exactly what the help
  page says, but it is what it suggests to me).
 
  Hum, I wonder how much code is based on the idea that a
  dataframe can hold
  a dataframe.
 
 I used to think that non-vectors in data.frames were

 pretty rare things but when I started looking into
 the details of the modelling code I discovered that
 matrices in data.frames are common.  E.g.,
  library(splines)
  sapply(model.frame(data=mtcars, mpg~ns(hp)+poly(disp,2)), class)
 $mpg
 [1] numeric
 
 $`ns(hp)`

 [1] ns basis  matrix
 
 $`poly(disp, 2)`

 [1] poly   matrix
 You may not see these things because you don't call model.frame()
 directly, but most modelling functions (e.g., lm() and glm())
 do call it and use the grouping provided by the matrices to encode
 how the columns of the design matrix are related to one another.
 
 If matrices are allowed, shouldn't data.frames be allowed as well?
 
 Bill Dunlap

 Spotfire, TIBCO Software
 wdunlap tibco.com
 
  15 years of using R just isn't enough! But, I can

  say that not
  one
  line of code I've written expects a dataframe to hold a dataframe.
 
   Hi,
 
   The following was already a topic on r-help, but after
  understanding
  what is
   going on, I think it fits better in r-devel.
 
   The problem is this:
   When a data.frame has another data.frame in it, rbind
  doesn't work well.
   Here is an example:
   --
a=data.frame(x=1:10,y=1:10)
b=data.frame(z=1:10)
b$a=a
b
   z a.x a.y
   1   1   1   1
   2   2   2   2
  

[Rd] suggestion for sweep help page

2010-07-23 Thread Claudia Beleites

Dear all,

I stumbled over the fact that sweep in fact calls FUN with appropriate arrays.
I used to think of it as apply-like to call a function with n-dimensional and 
n-1-dimensional arguments.


I suggest to put a sentence like:

sweep appropriately repeats STATS, and calls FUN with two arrays of the same 
size.

into the help page to clarify what input FUN should expect.


Claudia



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] S4 dispatch for .DollarNames (utils)

2010-05-30 Thread Claudia Beleites

Dear all,

thank your for this discussion - I had been wondering how to get the completion 
with my S4 class, but it didn't bother me enough to dig into things.


The workaround/hack that *does* work now, I believe, is to insert a 
dummy S3 class into the mix and define the S3 .DollarNames method for it.


Example:
  setOldClass(foo3)
  .DollarNames.foo3 - function(x, pattern)bar


My question here is: what is the dummy class needed for?

I have a few S3 methods for my S4 class (rbind.hyperSpec, cbind.hyperSpec, and 
now .DollarNames.hyperSpec). They seem to work just fine without first setting 
up a dummy S3 class that is then used in the contains of the S4 definition.

Any pitfalls with that?

Claudia



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] S4 dispatch for .DollarNames (utils)

2010-05-30 Thread Claudia Beleites

John,

Thank your for the explanation!

Claudia


--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


Re: [Rd] dots for sample -- implicitGeneric

2010-03-04 Thread Claudia Beleites

Dear Martin,

Martin Maechler wrote:

CB == Claudia Beleites cbelei...@units.it
on Sun, 28 Feb 2010 19:31:42 +0100 writes:


CB Dear R-Developers,
CB could 'sample' gain a ... argument?

As you may know, adding '...' also has drawbacks,
most notably that you lose automatic checking of correctly
specified argument names (when the function is called).
Yes, I'm aware of that - and was silently wondering whether one could do 
something against it (besides having nicely behaved functions without ... at the 
end of the call chain).




OTOH, R has now (since 2.9.0)  had sample.int() as a fast and robust
alternative.

Yes.
I had a quick thought whether I should do
sample (my.object) = new object with a subset of my.object's spectra
and
sample.int (my.object) = indices for use with my.object
I decided that this is bad, as I would expect that a function somefun.int does 
*expect* rather than *return* the integer.


The other thought was to have an additional function
isample that returns indices. Which after rethinking seems the right thing to 
do.

However this doesn't solve the implicitGeneric problem: if the object is 
returned I'd like to allow users to pass short messages that end up in the 
object's logbook.
But this can easily be postponed until R 2.11 is released and sample has the 
implicit generic also for normal users (= my colleagues who already complain 
if I ask them to update their R to the official release).




CB As a convenience function, I added a sample Method to my hyperSpec 
CB class. This function however has a flag indicating whether the results 
CB should be returned directly as a hyperSpec object or rather as indices 
CB that give a random sample.


CB For the moment, I use SetGeneric to add the dots argument, but this of 
CB course gives a warning that the base function sample is overwritten (and 
CB my colleagues are almost as scared of warnings as of errors...)


and they are not the only ones ... 


For a while now, we have (in 'methods') the possibility to make
functions implicit generic,  see  ?implicitGeneric ,
exactly for purposes like (I think)  you have here
( and notably to ensure that if *different* packages do this,
  they get compatible versions of the generic,
  and hence all the different method definitions will be
  attached to the same generic )


Yes, thank you - that's what I really wanted!
I'll do my homework and reread the chaper in Chambers' book.


Namely, you'd want to define S4 methods (and hence make 'sample' an S4 generic)
with new arguments in your package.

Exactly.


So, yes, I now have added 'sample' to the list of functions
that we make implicitGeneric in R.

Thanks a lot.


-- Get a version of R-devel, (svn revision = 51202)
and try the following:


setClass(foo, contains=vector)

[1] foo


setMethod(sample, foo, function(x, size, myArg, ...) sprintf(sample(foo, 
myArg=%s)\n,myArg))

Restoring the implicit generic function for ‘sample’ from package ‘base’
into package ‘.GlobalEnv’; the generic differs from the default conversion 
(Formal arguments differ: (x, size, replace, prob), (x, size, replace, prob, 
...))
Creating a new generic function for sample in .GlobalEnv
[1] sample


sample(new(foo), myArg = 64)

[1] sample(foo, myArg=64)\n

Wonderful. Works like a charm. Thanks a lot.

Thanks for your kind help,

Claudia






Best regards,
Martin Maechler, ETH Zurich


CB Thanks,
CB Claudia

CB -- 
CB Claudia Beleites

CB Dipartimento dei Materiali e delle Risorse Naturali
CB Università degli Studi di Trieste
CB Via Valerio 2
CB I-34127 Trieste
CB ITALY

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



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] dots for sample

2010-02-28 Thread Claudia Beleites

Dear R-Developers,

could 'sample' gain a ... argument?

As a convenience function, I added a sample Method to my hyperSpec 
class. This function however has a flag indicating whether the results 
should be returned directly as a hyperSpec object or rather as indices 
that give a random sample.


For the moment, I use SetGeneric to add the dots argument, but this of 
course gives a warning that the base function sample is overwritten (and 
my colleagues are almost as scared of warnings as of errors...)


Thanks,

Claudia



--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Valerio 2
I-34127 Trieste
ITALY

email: cbelei...@units.it
phone: +39 (0 40) 5 58-34 68

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


Re: [Rd] [SoC] R and Google Summer of Code 2010: Call for Proposals -

2010-02-27 Thread Claudia Beleites

May I ask for a bit of help?

I'd like to participate with my hyperSpec project. I set up a proposal page in 
the wiki 
[http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010:hyperspec].


hyperSpec is about handling spectroscopic (hyperspectral) data in R. It is thus 
a project that is aimed at a rather specific group of R users - far less broad 
audience than the other projects listed there.


Is it OK if I have that project in that GSoC 2010 list?

I'd really appreciate comments!

Thanks,

Claudia






Dirk Eddelbuettel wrote:

On 24 February 2010 at 11:09, Philippe Grosjean wrote:
| I have created the projects subsection in developers. The Google 
| Summer of Code 2010 is at 
| http://rwiki.sciviews.org/doku.php?id=developers:projects:googlesummer2010


We dediced to make this 


   http://rwiki.sciviews.org/doku.php?id=developers:projects:gsoc2010

to stick with the common 'GSoC' acronym.  So go ahead and submit ideas!

Dirk




--
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 0 40 5 58-37 68
email: cbelei...@units.it

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


[Rd] Sweave errors during package building

2009-08-04 Thread Claudia Beleites
Dear all,

I just spent quite a while fixing a weird error in my vignettes while doing
R CMD build and R CMD check
R CMD Sweave ran fine, though.

The cause turned out to be:

1. I have a data set flu,
2. and  a corresponding vignette explaining things one can do with that 
object. This vignette creates another object flu (which masks the packages 
one). 
3. Now when the next vignette is processed, this object created by the first 
vignette still exists, and still masks the packaged data set.

I was assuming that the building and checking processes are like R CMD Sweave, 
but this is not the case: they are like Sweave inside R, which will also 
change objects in the workspace (as I now know, see the example).

Maybe I didn't enough RTFM, but I was completely unaware of that before.

Would it be a good idea to have a few words about this in the FAQ and in the 
help page? 

Claudia


file testsweave.Rnw:
test=
a - 3
b - 1
@ 

now in R:
 a - 4
 a
[1] 4
 b
Error: object 'b' not found
 Sweave (testsweave.Rnw)
Writing to file testsweave.tex
Processing code chunks ...
 1 : echo term verbatim (label=test)

You can now run LaTeX on 'testsweave.tex'
 a
[1] 3
 b
[1] 1
 



-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali 
Università degli Studi di Trieste 
Via Alfonso Valerio 6/a 
I-34127 Trieste

phone: +39 0 40 5 58-37 68 
email: cbelei...@units.it

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


Re: [Rd] methods vs. functions

2009-01-07 Thread Claudia Beleites
Dear Duncan and Oleg,

thanks for your answers. 

For the moment, I'll use functions. 

Happy new year, 

Claudia

-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 (0 40) 5 58-34 47
email: cbelei...@units.it

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


Re: [Rd] ... (dotMethods) and cbind/rbind: how to give the signature?

2009-01-07 Thread Claudia Beleites
Dear Oleg,

thanks a lot! 
I'll have S3 methods until the problems settle somehow.

I wasn't aware that S3 despatch works for S4 classes as well.

Claudia

-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 (0 40) 5 58-34 47
email: cbelei...@units.it

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


[Rd] ... (dotMethods) and cbind/rbind: how to give the signature?

2008-12-22 Thread Claudia Beleites
Dear List,

I'm struggling with the signature writing cbind/rbind functions for a S4 
class.

First of all, I'm very happy that it is now possible to dispatch on ...
I follow the example for paste in ?dotMethods, which works as far as this:

### start example
setClass (cbtest,
  representation = representation (data = data.frame),
  prototype = prototype (data = data.frame (spc = I (matrix (rnorm 
(15) , 3, 5)))
)
 )

a - new (cbtest)
a

setMethod(cbind2, signature (x = cbtest, y  = cbtest),
  function (x, y){
x...@data$spc - cbind (x...@data$spc, y...@data$spc) 
x
  }
  )


setMethod(cbind2, signature (x = cbtest, y = missing), function (x, y) 
x)

cb.cbind - function (..., deparse.level){
  dots - list (...) 
  for (i in seq_along (dots)[-1])
dots[[1]] - cbind2 (dots[[1]], dots[[i]])

  dots[[1]]
} 


cbind2 (a, a)
cb.cbind (a, a, a)


cbind (a, a, a)
setGeneric (cbind, signature = signature(...)) 
setMethod (cbind, cbtest,
   function (..., deparse.level) cb.cbind (...))
cbind (a, a, a)
cbind (a, a, a, deparse.level = 1)

### end example


However, I get the following message:
with setGeneric 

Creating a generic for cbind in package  .GlobalEnv
(the supplied definition differs from and overrides the implicit generic in 
package base: Signatures differ:  (...), (deparse.level))

How do I specify the correct signature? 

Furthermore: as I do not want to do anything with deparse.level, I'd rather 
specify it as missing in setMethod. But again, I don't get the signature 
correct.

I tried 
setGeneric (cbind, signature = signature (...=..., deparse.level = 
integer))
and 
setGeneric (cbind, signature = signature (..., deparse.level = integer))

both give: 
Fehler in makeGeneric(name, fdef, fdeflt, group = group, valueClass = 
valueClass,  : 
  Nicht-Argumente in der Signatur: integer

What is my mistake?

Thanks a lot for your help!

Claudia


 version
   _   
platform   i486-pc-linux-gnu   
arch   i486
os linux-gnu   
system i486, linux-gnu 
status 
major  2   
minor  8.0 
year   2008
month  10  
day20  
svn rev46754   
language   R   
version.string R version 2.8.0 (2008-10-20)


-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 (0 40) 5 58-34 47
email: cbelei...@units.it

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


[Rd] methods vs. functions

2008-12-22 Thread Claudia Beleites
Dear List,

a second, more general, question concerning S4 classes.

I have a bunch of functions/methods for my class. 

At the moment I have them as methods, because they work on objects of my S4 
class and therefore belong to that class.

On the other hand, it is comparably unlikely that someone else wants the same 
kind of method. 
And package.skeleton () produces the xzy-methods.Rds. But for the 
documentation I rather need normal function definitions. I know that I can 
write the Rd files just as if it was a normal function, but this got me to ask 
myself whether it is a good idea to have methods or whether I should rather 
use normal functions?

If I understood the concept of namespace correctly, a package with a namespace 
avoids trouble with clashing function names - so I don't need to worry about 
that using functions (I anyways have some functions, that should not be 
methods of the class).

Any comments?

Thanks a lot!

Claudia

-- 
Claudia Beleites
Dipartimento dei Materiali e delle Risorse Naturali
Università degli Studi di Trieste
Via Alfonso Valerio 6/a
I-34127 Trieste

phone: +39 (0 40) 5 58-34 47
email: cbelei...@units.it

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