Re: [Rd] requesting a new SIG mailing list

2012-02-14 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13/02/12 17:30, Mauricio Zambrano-Bigiarini wrote:
 Dear R developers,
 
 Due to the increasing use R in hydrology and other close-related 
 environmental sciences, I would like to ask if it would be possible
 to create a new Special Interest Group mailing list, called
 'R-sig-hydro', specially devoted those topics. If possible to do
 so, I'd offer myself to maintain such mailing list (if needed).

I think it would be more useful to use the R-sig-geo for that, as
hydrology (please correct me if I am wrong - I am not an expert in
hydrology) is mainly spatial.

A fragmentation of the lists would need to duplicate effort by members.

Cheers,

Rainer


 
 
 Thanks in advance,
 
 Mauricio Zambrano-Bigiarini
 


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk86HRQACgkQoYgNqgF2egp1pwCfXrUJEBhQ8+50iwv7iYEZXa1C
7l4Anj9EmGCL3QE61VGZ/bw+/3r8n5b4
=bVRp
-END PGP SIGNATURE-

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


Re: [Rd] requesting a new SIG mailing list

2012-02-14 Thread Mauricio Zambrano-Bigiarini

On 14/02/12 09:36, Rainer M Krug wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13/02/12 17:30, Mauricio Zambrano-Bigiarini wrote:

Dear R developers,

Due to the increasing use R in hydrology and other close-related
environmental sciences, I would like to ask if it would be possible
to create a new Special Interest Group mailing list, called
'R-sig-hydro', specially devoted those topics. If possible to do
so, I'd offer myself to maintain such mailing list (if needed).


I think it would be more useful to use the R-sig-geo for that, as
hydrology (please correct me if I am wrong - I am not an expert in
hydrology) is mainly spatial.

A fragmentation of the lists would need to duplicate effort by members.


I don't want to duplicate efforts, but I'm not sure about R-sig-geo as 
the right mailing list for hydrology and close-related environmental 
sciences.


It is true that hydrology has much to do with spatial analysis 
(interpolation techniques, use of satellite images as input for 
hydrological models, mapping, etc), but it has also a strong link to 
time series analysis (trend detection, stationary and non-stationary 
water quantity and quality modelling, climate change modelling, and a 
long etc), and probably the latter topics would be considered off-topic 
in the R-sig-geo


Another possibility could be to use the R-sig-ecology, which seems to be 
more related to hydrology:


analytical techniques and topics that are appropriate for discussion on 
R-sig-ecology are quite broad. For examples of what might be appropriate 
for discussion on this list, please see the Environmentrics Task View 
(http://cran.r-project.org/web/views/Environmetrics.html)

(taken from: https://stat.ethz.ch/mailman/listinfo/r-sig-ecology)

However, I did a quick search on the archives of 'R-sig-ecology' for the 
year 2011, and I could only found one single mail related to hydrology:


https://stat.ethz.ch/pipermail/r-sig-ecology/2011-July/002274.html

(in the same search I couldn't find any single reference to hydrology in 
the R-sig-geo during the year 2011)


I think the lack of posts related to hydrological sciences in dedicated 
R-sig-xxx mailing lists is not due to a lack of interest (in the same 
period I got several questions regarding the hydroTSM and hydroGOF 
packages), but they may be due to the fact that r-sig-geo or 
r-sig-ecology are not very intuitive for hydrologists


So, if you think that creating a new mailing list only for hydrology and 
related sciences could lead to fragmentation of the community and a 
duplication of efforts, we could start using the 'R-sig-ecology' mailing 
list.


Cheers,


Mauricio Zambrano-Bigiarini

--
===
FLOODS Action
Water Resources Unit (H01)
Institute for Environment and Sustainability (IES)
European Commission, Joint Research Centre (JRC)
TP 261, Via Enrico Fermi 2749, 21027 Ispra (VA), Italy
webinfo: http://floods.jrc.ec.europa.eu/
===
DISCLAIMER:
The views expressed are purely those of the writer
and may not in any circumstances be regarded as stating
an official position of the European Commission.
===
Linux user #454569 -- Ubuntu user #17469
===
The greatest inspiration is often born of desperation.
(Comer Cotrell)





Cheers,

Rainer





Thanks in advance,

Mauricio Zambrano-Bigiarini




- --
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :   +33 - (0)9 53 10 27 44
Cell:   +33 - (0)6 85 62 59 98
Fax :   +33 - (0)9 58 10 27 44

Fax (D):+49 - (0)3 21 21 25 22 44

email:  rai...@krugs.de

Skype:  RMkrug
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk86HRQACgkQoYgNqgF2egp1pwCfXrUJEBhQ8+50iwv7iYEZXa1C
7l4Anj9EmGCL3QE61VGZ/bw+/3r8n5b4
=bVRp
-END PGP SIGNATURE-



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


[Rd] method using several (and different) arguments in turn

2012-02-14 Thread james.foadi
Dear R-developers community, I have the following generic:

setGeneric(
   name=newsample,
   def=function(x,y,z,a,b,c,...){standardGeneric(newsample)}

And I can build several methods for this generic. One useful thing is to use 
newsample
with only one of the 6 arguments listed. At the moment this is what I do:

setMethod(
   f=newsample,
   
signature=c(missing,missing,numeric,missing,missing,missing),
   function(x,y,z,a,b,c,...)
   {
   ..
   ..

}
)

This would be used when the single argument is z:

newsample(z=12.5)

To use newsample with another argument (say x) I should implement the same as 
before,
but with signature 
c(numeric,missing,missing,missing,missing,missing).
Is there another shorter and easier way to do this?


J

-- 
This e-mail and any attachments may contain confidential...{{dropped:8}}

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


Re: [Rd] requesting a new SIG mailing list

2012-02-14 Thread Prof Brian Ripley
Have you asked the maintainers of those lists?  Or the person who would 
have to do the work to set the list up (Martin Maechler, who is 
currently on vacation, or colleagues at ETHZ)?


My suspicion is that there would be too little traffic to make a 
separate list worthwhile to administer.  (You might feel so too: list 
administrators end up dealing with a lot of nuisance traffic.)


On 14/02/2012 16:31, Mauricio Zambrano-Bigiarini wrote:

On 14/02/12 09:36, Rainer M Krug wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13/02/12 17:30, Mauricio Zambrano-Bigiarini wrote:

Dear R developers,

Due to the increasing use R in hydrology and other close-related
environmental sciences, I would like to ask if it would be possible
to create a new Special Interest Group mailing list, called
'R-sig-hydro', specially devoted those topics. If possible to do
so, I'd offer myself to maintain such mailing list (if needed).


I think it would be more useful to use the R-sig-geo for that, as
hydrology (please correct me if I am wrong - I am not an expert in
hydrology) is mainly spatial.

A fragmentation of the lists would need to duplicate effort by members.


I don't want to duplicate efforts, but I'm not sure about R-sig-geo as
the right mailing list for hydrology and close-related environmental
sciences.

It is true that hydrology has much to do with spatial analysis
(interpolation techniques, use of satellite images as input for
hydrological models, mapping, etc), but it has also a strong link to
time series analysis (trend detection, stationary and non-stationary
water quantity and quality modelling, climate change modelling, and a
long etc), and probably the latter topics would be considered off-topic
in the R-sig-geo

Another possibility could be to use the R-sig-ecology, which seems to be
more related to hydrology:

analytical techniques and topics that are appropriate for discussion on
R-sig-ecology are quite broad. For examples of what might be appropriate
for discussion on this list, please see the Environmentrics Task View
(http://cran.r-project.org/web/views/Environmetrics.html)
(taken from: https://stat.ethz.ch/mailman/listinfo/r-sig-ecology)

However, I did a quick search on the archives of 'R-sig-ecology' for the
year 2011, and I could only found one single mail related to hydrology:

https://stat.ethz.ch/pipermail/r-sig-ecology/2011-July/002274.html

(in the same search I couldn't find any single reference to hydrology in
the R-sig-geo during the year 2011)

I think the lack of posts related to hydrological sciences in dedicated
R-sig-xxx mailing lists is not due to a lack of interest (in the same
period I got several questions regarding the hydroTSM and hydroGOF
packages), but they may be due to the fact that r-sig-geo or
r-sig-ecology are not very intuitive for hydrologists

So, if you think that creating a new mailing list only for hydrology and
related sciences could lead to fragmentation of the community and a
duplication of efforts, we could start using the 'R-sig-ecology' mailing
list.

Cheers,


Mauricio Zambrano-Bigiarini




--
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] method using several (and different) arguments in turn

2012-02-14 Thread Martin Morgan

On 02/14/2012 08:43 AM, james.fo...@diamond.ac.uk wrote:

Dear R-developers community, I have the following generic:

setGeneric(
name=newsample,
def=function(x,y,z,a,b,c,...){standardGeneric(newsample)}

And I can build several methods for this generic. One useful thing is to use 
newsample
with only one of the 6 arguments listed. At the moment this is what I do:

setMethod(
f=newsample,

signature=c(missing,missing,numeric,missing,missing,missing),
function(x,y,z,a,b,c,...)
{
..
..

 }
 )

This would be used when the single argument is z:

newsample(z=12.5)

To use newsample with another argument (say x) I should implement the same as 
before,
but with signature 
c(numeric,missing,missing,missing,missing,missing).
Is there another shorter and easier way to do this?


Hi James --

A matter of opinion, but multiple dispatch like this can be very 
complicated, e.g., figuring out the 'next' method when dispatching on 
two or more arguments; I'd really discourage it.


A different approach, assuming that x, y, z, ... are all numeric() but 
that the sample to be drawn differs, is to define a small class 
hierarchy to be used for dispatch.


  setClass(TypeOfSample)

  setClass(XSample, contains=TypeOfSample)
  XSample - new(XSample)  ## a 'singleton', used for dispatch

  setClass(YSample, contains=TypeOfSample)
  YSample - new(YSample)

and then

  setGeneric(newsample,
  function(type, x=numeric(), ...) standardGeneric(newsample),
  signature=type)

  setMethod(newsample, XSample, function(type, x=numeric(), ...) {
  XSample
  })

  setMethod(newsample, YSample, function(type, x=numeric(), ...) {
  YSample
  })

One could implement a default method on TypeOfSample, and use 
callNextMethod() after initial transformation, if that were the pattern.


To use:

  newsample(XSample, x=1:100)

Martin




J




--
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793

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


Re: [Rd] requesting a new SIG mailing list

2012-02-14 Thread Mauricio Zambrano-Bigiarini

On 14/02/12 17:45, Prof Brian Ripley wrote:

Have you asked the maintainers of those lists? Or the person who would
have to do the work to set the list up (Martin Maechler, who is
currently on vacation, or colleagues at ETHZ)?


No, I haven't done yet, but I'll do it, to know which list is the right 
one for hydrology.




My suspicion is that there would be too little traffic to make a
separate list worthwhile to administer. (You might feel so too: list
administrators end up dealing with a lot of nuisance traffic.)


Probably you are right, and it is worth to wait until the traffic in 
some of those lists be enough to justify a different mailing list.


Thank you very much for your feedback prof. Ripley.


All the best,

Mauricio Zambrano-Bigiarini

--
===
FLOODS Action
Water Resources Unit (H01)
Institute for Environment and Sustainability (IES)
European Commission, Joint Research Centre (JRC)
TP 261, Via Enrico Fermi 2749, 21027 Ispra (VA), Italy
webinfo: http://floods.jrc.ec.europa.eu/
===
DISCLAIMER:
The views expressed are purely those of the writer
and may not in any circumstances be regarded as stating
an official position of the European Commission.
===
Linux user #454569 -- Ubuntu user #17469
===



On 14/02/2012 16:31, Mauricio Zambrano-Bigiarini wrote:

On 14/02/12 09:36, Rainer M Krug wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 13/02/12 17:30, Mauricio Zambrano-Bigiarini wrote:

Dear R developers,

Due to the increasing use R in hydrology and other close-related
environmental sciences, I would like to ask if it would be possible
to create a new Special Interest Group mailing list, called
'R-sig-hydro', specially devoted those topics. If possible to do
so, I'd offer myself to maintain such mailing list (if needed).


I think it would be more useful to use the R-sig-geo for that, as
hydrology (please correct me if I am wrong - I am not an expert in
hydrology) is mainly spatial.

A fragmentation of the lists would need to duplicate effort by members.


I don't want to duplicate efforts, but I'm not sure about R-sig-geo as
the right mailing list for hydrology and close-related environmental
sciences.

It is true that hydrology has much to do with spatial analysis
(interpolation techniques, use of satellite images as input for
hydrological models, mapping, etc), but it has also a strong link to
time series analysis (trend detection, stationary and non-stationary
water quantity and quality modelling, climate change modelling, and a
long etc), and probably the latter topics would be considered off-topic
in the R-sig-geo

Another possibility could be to use the R-sig-ecology, which seems to be
more related to hydrology:

analytical techniques and topics that are appropriate for discussion on
R-sig-ecology are quite broad. For examples of what might be appropriate
for discussion on this list, please see the Environmentrics Task View
(http://cran.r-project.org/web/views/Environmetrics.html)
(taken from: https://stat.ethz.ch/mailman/listinfo/r-sig-ecology)

However, I did a quick search on the archives of 'R-sig-ecology' for the
year 2011, and I could only found one single mail related to hydrology:

https://stat.ethz.ch/pipermail/r-sig-ecology/2011-July/002274.html

(in the same search I couldn't find any single reference to hydrology in
the R-sig-geo during the year 2011)

I think the lack of posts related to hydrological sciences in dedicated
R-sig-xxx mailing lists is not due to a lack of interest (in the same
period I got several questions regarding the hydroTSM and hydroGOF
packages), but they may be due to the fact that r-sig-geo or
r-sig-ecology are not very intuitive for hydrologists

So, if you think that creating a new mailing list only for hydrology and
related sciences could lead to fragmentation of the community and a
duplication of efforts, we could start using the 'R-sig-ecology' mailing
list.

Cheers,


Mauricio Zambrano-Bigiarini






The greatest inspiration is often born of desperation.
(Comer Cotrell)

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


Re: [Rd] requesting a new SIG mailing list

2012-02-14 Thread Sarah Goslee
Hello,

I'm one of the maintainers of the r-sig-ecology list, and I think
it would be entirely appropriate to include hydrology within
the scope of the list.

There hasn't been much hydrologic discussion, as you noted,
but not because we wish to exclude it.

Sarah

On Tue, Feb 14, 2012 at 11:31 AM, Mauricio Zambrano-Bigiarini
mauricio.zambr...@jrc.ec.europa.eu wrote:

 Another possibility could be to use the R-sig-ecology, which seems to be
 more related to hydrology:

 analytical techniques and topics that are appropriate for discussion on
 R-sig-ecology are quite broad. For examples of what might be appropriate for
 discussion on this list, please see the Environmentrics Task View
 (http://cran.r-project.org/web/views/Environmetrics.html)
 (taken from: https://stat.ethz.ch/mailman/listinfo/r-sig-ecology)

 However, I did a quick search on the archives of 'R-sig-ecology' for the
 year 2011, and I could only found one single mail related to hydrology:

 https://stat.ethz.ch/pipermail/r-sig-ecology/2011-July/002274.html

 (in the same search I couldn't find any single reference to hydrology in the
 R-sig-geo during the year 2011)

-- 
Sarah Goslee
http://www.functionaldiversity.org

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


Re: [Rd] method using several (and different) arguments in turn

2012-02-14 Thread james.foadi
Dear Martin,
I could not entirely follow your suggestion.
I can see how you define two classes inheriting from TypeOfSample, and how 
these two
classes have two associated methods (incidentally, I'm unfamiliar with the:

   function(type,x=numeric(),...)to do.

J


expression. What is type?

But then I'm lost. I wouldn't know how to carry on from here. 

I don't know if I have explained the key point clear enough before. For the 
person using
newsample it makes sense which name (x or y or z, etc) is used. 
newsample(x=12.4) would
give something different from newsample(y=12.4); and yet another result would 
be obtained if
using a combination, like newsample(x=12.4,y=12.4).

I wanted to use a simple function with default values at first, but I'm in the 
middle of developing
a package using S4 formalism. I'm not sure this would be a wise thing 

Sent: 14 February 2012 17:00
To: Foadi, James (Imperial Coll.,RAL,DIA)
Cc: r-devel@r-project.org
Subject: Re: [Rd] method using several (and different) arguments in turn

On 02/14/2012 08:43 AM, james.fo...@diamond.ac.uk wrote:
 Dear R-developers community, I have the following generic:

 setGeneric(
 name=newsample,
 
 def=function(x,y,z,a,b,c,...){standardGeneric(newsample)}

 And I can build several methods for this generic. One useful thing is to use 
 newsample
 with only one of the 6 arguments listed. At the moment this is what I do:

 setMethod(
 f=newsample,
 
 signature=c(missing,missing,numeric,missing,missing,missing),
 function(x,y,z,a,b,c,...)
 {
 ..
 ..

  }
  )

 This would be used when the single argument is z:

 newsample(z=12.5)

 To use newsample with another argument (say x) I should implement the same as 
 before,
 but with signature 
 c(numeric,missing,missing,missing,missing,missing).
 Is there another shorter and easier way to do this?

Hi James --

A matter of opinion, but multiple dispatch like this can be very
complicated, e.g., figuring out the 'next' method when dispatching on
two or more arguments; I'd really discourage it.

A different approach, assuming that x, y, z, ... are all numeric() but
that the sample to be drawn differs, is to define a small class
hierarchy to be used for dispatch.

   setClass(TypeOfSample)

   setClass(XSample, contains=TypeOfSample)
   XSample - new(XSample)  ## a 'singleton', used for dispatch

   setClass(YSample, contains=TypeOfSample)
   YSample - new(YSample)

and then

   setGeneric(newsample,
   function(type, x=numeric(), ...) standardGeneric(newsample),
   signature=type)

   setMethod(newsample, XSample, function(type, x=numeric(), ...) {
   XSample
   })

   setMethod(newsample, YSample, function(type, x=numeric(), ...) {
   YSample
   })

One could implement a default method on TypeOfSample, and use
callNextMethod() after initial transformation, if that were the pattern.

To use:

   newsample(XSample, x=1:100)

Martin



 J



--
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793

-- 
This e-mail and any attachments may contain confidential...{{dropped:8}}

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


Re: [Rd] Task views

2012-02-14 Thread Ravi Varadhan
A couple of (lengthier!) suggestions: topic-area resources or task-oriented 
resources

Ravi

From: r-devel-boun...@r-project.org [r-devel-boun...@r-project.org] on behalf 
of Patrick Burns [pbu...@pburns.seanet.com]
Sent: Monday, February 13, 2012 4:32 AM
To: Barry Rowlingson
Cc: Hans W Borchers; r-devel
Subject: Re: [Rd] Task views

I feel compelled to rebuff Barry's
attack on the word Task Views.
I think it is a fine description (I
was not involved in originating it),
though of course I'd be open to better
suggestions.

Look at all these things you can do with R
is also nice but lacks a certain amount
of brevity.

Pat

On 12/02/2012 10:43, Barry Rowlingson wrote:
 On Sat, Feb 11, 2012 at 5:55 PM, Patrick Burnspbu...@pburns.seanet.com  
 wrote:

 Now it could be that people are not trying
 very hard to solve their own problems, but
 to be fair it is a pretty gruelling process
 to find the Task Views.

 May I suggest that there be a Task Views item
 on the left sidebar of the R website in the
 Documentation section?


   I'd go further, and suggest that the list of Task Views appears on
 the home page of www.r-project.org under the heading Look at all
 these things you can do with R. (Maybe to replace the 8 year old
 clustering graphic (or maybe someone could do something in ggplot2
 that looks nice n shiny?) )

   Task Views (stupid name, who's idea was that?) are an absolute GEM
 and shouldn't be slotted between 'What's New?' and Search on CRAN
 mirror sites. The CRAN Task Views page doesn't even say what Task
 Views are. Here's some text that might help:

   Task Views are short documents outlining the functionality of R in a
 given field or methodology. Since most of R's power comes from add-on
 packages downloaded from CRAN, Task Views tend to concentrate on
 summarising the packages that are relevant. If you ever find yourself
 thinking 'how do I do X in R?' then the list of Task Views should be
 your first stop.

 Barry


--
Patrick Burns
pbu...@pburns.seanet.com
twitter: @portfolioprobe
http://www.portfolioprobe.com/blog
http://www.burns-stat.com
(home of 'Some hints for the R beginner'
and 'The R Inferno')

__
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] read.spss issues

2012-02-14 Thread Jeroen Ooms
Someone supplied me with a small SPSS datafile that caused a buffer
overflow and then a crash when reading it in R. It seems like a pretty
serious issue to me. Unfortunately I can't supply the dataset at hand
and I have a hard time reproducing it with a toy example. But I found
at least 2 issues that might be related.

The first one is that when the spss dataset has a 'string' variable
that is longer than 200 characters, it generates a bunch of warnings
and then additional variables in the dataset. E.g:

library(foreign)
x - read.spss(http://www.stat.ucla.edu/~jeroen/spss/longstring.sav;);
str(x);

The second problem is that the spss dataformat allows to specify
'duplicate labels', whereas this is not allowed for factors. read.spss
does not deal with this and creates a bad factor

x - read.spss(http://www.stat.ucla.edu/~jeroen/spss/duplicate_labels.sav;,
use.value.labels=T);
levels(x$opinion);

which causes issues downstream. I am not sure if this is an issue in
read.spss() or as.factor(), but I guess it might be wise to try to
detect duplicate levels and assign them all with one and the same
integer value when converting to a factor.

Thank you,

Jeroen

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