[Rd] Using SVN + SSH on windows

2010-03-27 Thread Christophe Genolini

Hi the list,
I try to use R-Forge for developping a projet. I am using tortoise SVN 
(last version) but I do not manage to Commit. I read the R-Forge user 
Manual and some post on  but I do not manage to find the solution. Here 
is what I did:


1/ I download 'puttygen.exe'. I generate a key (256 bits).
2/ I save the private key in a file 'private.ppk' on my computer.
3/ I copy-paste the public key on sourceforge
ssh-rsa 
B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs= 
rsa-key-20100327

4/ I wait two hours.
5/ On my computer, I run 'pageant.exe'.
6/ I click on 'Add key'. I load the file 'private.ppk'
7/ I close 'pageant.exe' (still actif in the task bar).
8/ I open explorer. I create a directory that is suppose to be the 
local directoy for the projet.

9/ I right-click on the directory. I open 'SVN checkout'
10/ In 'URL of  repository:', I write : 
'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'

(christophe is my accoung, kml3d is the project)
And...

...nothing happen. No bug, not warning, nothing.

I try several things: if I do 
'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage 
to download the project. But then, I do not manage to upload some 
modification.


I also see on some tutorial that we might need putty.exe or plink.exe. I 
download them, but R-Forge user Manual do not mention them.


Any idea of what goes wrong ?

Thanks
Christophe

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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Uwe Ligges
From my memory: I guess you need to tell TortoiseSVN to use plink as 
your ssh client. I do not use putty myself hence cannot look into the 
details here.


Uwe Ligges






On 27.03.2010 15:12, Christophe Genolini wrote:

Hi the list,
I try to use R-Forge for developping a projet. I am using tortoise SVN
(last version) but I do not manage to Commit. I read the R-Forge user
Manual and some post on but I do not manage to find the solution. Here
is what I did:

1/ I download 'puttygen.exe'. I generate a key (256 bits).
2/ I save the private key in a file 'private.ppk' on my computer.
3/ I copy-paste the public key on sourceforge
ssh-rsa
B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
rsa-key-20100327
4/ I wait two hours.
5/ On my computer, I run 'pageant.exe'.
6/ I click on 'Add key'. I load the file 'private.ppk'
7/ I close 'pageant.exe' (still actif in the task bar).
8/ I open explorer. I create a directory that is suppose to be the local
directoy for the projet.
9/ I right-click on the directory. I open 'SVN checkout'
10/ In 'URL of repository:', I write :
'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
(christophe is my accoung, kml3d is the project)
And...

...nothing happen. No bug, not warning, nothing.

I try several things: if I do
'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage
to download the project. But then, I do not manage to upload some
modification.

I also see on some tutorial that we might need putty.exe or plink.exe. I
download them, but R-Forge user Manual do not mention them.

Any idea of what goes wrong ?

Thanks
Christophe

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


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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Henrik Bengtsson
On Sat, Mar 27, 2010 at 3:12 PM, Christophe Genolini
cgeno...@u-paris10.fr wrote:
 Hi the list,
 I try to use R-Forge for developping a projet. I am using tortoise SVN (last
 version) but I do not manage to Commit. I read the R-Forge user Manual and
 some post on  but I do not manage to find the solution. Here is what I did:

 1/ I download 'puttygen.exe'. I generate a key (256 bits).
 2/ I save the private key in a file 'private.ppk' on my computer.
 3/ I copy-paste the public key on sourceforge
 ssh-rsa
 B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
 rsa-key-20100327
 4/ I wait two hours.
 5/ On my computer, I run 'pageant.exe'.
 6/ I click on 'Add key'. I load the file 'private.ppk'
 7/ I close 'pageant.exe' (still actif in the task bar).
 8/ I open explorer. I create a directory that is suppose to be the local
 directoy for the projet.
 9/ I right-click on the directory. I open 'SVN checkout'
 10/ In 'URL of  repository:', I write :
 'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
 (christophe is my accoung, kml3d is the project)
 And...

 ...nothing happen. No bug, not warning, nothing.

 I try several things: if I do
 'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage to
 download the project. But then, I do not manage to upload some modification.

All looks ok, but I think you are using the wrong protocol.  It should
be 'svn+ssh' for *commits*, i.e.

svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d

which *is* shown at http://r-forge.r-project.org/scm/?group_id=727

/Henrik

PS. Don't think you need plink, but I might be wrong.


 I also see on some tutorial that we might need putty.exe or plink.exe. I
 download them, but R-Forge user Manual do not mention them.

 Any idea of what goes wrong ?

 Thanks
 Christophe

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


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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Henrik Bengtsson
2010/3/27 hb h...@stat.berkeley.edu:
 On Sat, Mar 27, 2010 at 3:12 PM, Christophe Genolini cgeno...@u-paris10.fr 
 wrote:
 Hi the list,
 I try to use R-Forge for developping a projet. I am using tortoise SVN (last
 version) but I do not manage to Commit. I read the R-Forge user Manual and
 some post on  but I do not manage to find the solution. Here is what I did:

 1/ I download 'puttygen.exe'. I generate a key (256 bits).
 2/ I save the private key in a file 'private.ppk' on my computer.
 3/ I copy-paste the public key on sourceforge
 ssh-rsa
 B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
 rsa-key-20100327
 4/ I wait two hours.
 5/ On my computer, I run 'pageant.exe'.
 6/ I click on 'Add key'. I load the file 'private.ppk'
 7/ I close 'pageant.exe' (still actif in the task bar).
 8/ I open explorer. I create a directory that is suppose to be the local
 directoy for the projet.
 9/ I right-click on the directory. I open 'SVN checkout'
 10/ In 'URL of  repository:', I write :
 'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
 (christophe is my accoung, kml3d is the project)
 And...

 ...nothing happen. No bug, not warning, nothing.

 I try several things: if I do
 'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage to
 download the project. But then, I do not manage to upload some modification.

 All looks ok, but I think you are using the wrong protocol. It should be 
 'svn+ssh' for *commits*, i.e.

 svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d

 which *is* shown at http://r-forge.r-project.org/scm/?group_id=727

Sorry, I missed that you've tried that (I scrolled past it on my small screen).

- When you generated a key in PUTTYgen, did you enter a passphrase?  I
think you have to leave that blank.

- Make sure not to have any newlines/spaces in the key, when you paste
it, that is, you should have:

Line 1: ssh-rsa
Line 2: long key

You can have multiple entries as the above.

- You need to checkout with the svn+ssh URL, because that it is what
TortoiseSVN will use for commits (unless you do relocate).  If you
can checkout using this protocol, you should be able to commit.  Thus,
focus your troubleshooting on checking out.

- In the Default Settings PuTTY Configurations, make sure Attempt
authentication using Pageant is checked under the Connection - SSH
- Auth panel.

- Make sure Pageant lists the key in its dialog.

Does it work?

/Henrik


 /Henrik

 PS. Don't think you need plink, but I might be wrong.


 I also see on some tutorial that we might need putty.exe or plink.exe. I
 download them, but R-Forge user Manual do not mention them.

 Any idea of what goes wrong ?

 Thanks
 Christophe

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




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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Christophe Genolini

Henrik Bengtsson a écrit :

2010/3/27 hb h...@stat.berkeley.edu:
  

On Sat, Mar 27, 2010 at 3:12 PM, Christophe Genolini cgeno...@u-paris10.fr 
wrote:


Hi the list,
I try to use R-Forge for developping a projet. I am using tortoise SVN (last
version) but I do not manage to Commit. I read the R-Forge user Manual and
some post on  but I do not manage to find the solution. Here is what I did:

1/ I download 'puttygen.exe'. I generate a key (256 bits).
2/ I save the private key in a file 'private.ppk' on my computer.
3/ I copy-paste the public key on sourceforge
ssh-rsa
B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
rsa-key-20100327
4/ I wait two hours.
5/ On my computer, I run 'pageant.exe'.
6/ I click on 'Add key'. I load the file 'private.ppk'
7/ I close 'pageant.exe' (still actif in the task bar).
8/ I open explorer. I create a directory that is suppose to be the local
directoy for the projet.
9/ I right-click on the directory. I open 'SVN checkout'
10/ In 'URL of  repository:', I write :
'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
(christophe is my accoung, kml3d is the project)
And...

...nothing happen. No bug, not warning, nothing.

I try several things: if I do
'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage to
download the project. But then, I do not manage to upload some modification.
  

All looks ok, but I think you are using the wrong protocol. It should be 
'svn+ssh' for *commits*, i.e.

svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d

which *is* shown at http://r-forge.r-project.org/scm/?group_id=727



  
Now, in addition, I configure putty as Uwe advice me. I follow the 
tutorial http://www.mono-project.com/Putty_and_TortoiseSvn

Sorry, I missed that you've tried that (I scrolled past it on my small screen).

- When you generated a key in PUTTYgen, did you enter a passphrase?  I
think you have to leave that blank.

- Make sure not to have any newlines/spaces in the key, when you paste
it, that is, you should have:

Line 1: ssh-rsa
Line 2: long key
  
On two line ? On R-forge, they say /Make sure there are no line breaks 
except between keys./

You can have multiple entries as the above.

- You need to checkout with the svn+ssh URL, because that it is what
TortoiseSVN will use for commits (unless you do relocate).  If you
can checkout using this protocol, you should be able to commit.  Thus,
focus your troubleshooting on checking out.

- In the Default Settings PuTTY Configurations, make sure Attempt
authentication using Pageant is checked under the Connection - SSH
- Auth panel.
  

I did

- Make sure Pageant lists the key in its dialog.

  

It is.


Does it work?

  

No. In putty, I get :
login as: christophe

Then a pop up say : Assertion failed!
Program:...\pageant.exe
File: ..\sshrsa.c
Line:793
...

Then I click ignore

On putty again :

Authenticating with public key rsa-key-20100327 from agent
Access denied
christo...@kml3d.r-forge.r-project.org's password:
Linux xmrforge2 2.6.18-xen #1 SMP Fri May 18 16:01:42 BST 2007 x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Mar 27 17:56:55 2010 from 
def92-4-82-225-59-146.fbx.proxad.net

This is a restricted account.
You cannot execute anything here.
Goodbye.




/Henrik

  

/Henrik

PS. Don't think you need plink, but I might be wrong.



I also see on some tutorial that we might need putty.exe or plink.exe. I
download them, but R-Forge user Manual do not mention them.

Any idea of what goes wrong ?

Thanks
Christophe

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

  






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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Gabor Grothendieck
I am using TortoiseSVN 1.6.7 on Vista and right clicking in Windows
explorer and choosing
   TortoiseSVN | TortoiseSVN Settings | Network
gives a blank dialog.   In fact I don't think I have ever used the
TortoiseSVN Network dialog at all yet I am able to use TortoiseSVN to
send commits to R-Forge.

Not sure it matters but I normally run pageant from the command line like this:
pageant \mydir\privatekey.ppk

I also had a lot of problems getting commits to R-Forge to work from
Windows.  The entire system is really geared to UNIX.  It took me a
couple of days of trial and error (since you have to wait 20 minutes
for each try) before I got it working.  Although I did get it to work,
I ultimately decided to host all my packages on googlecode.
googlecode is extremely easy to use from Windows and does not require
any public/private key, pageant, etc.  e.g.
http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
how to use it then you can probably set up a googlecode site in
literally 5 minutes.

One other possibility.  I think there is a way to host your project on
googlecode but still have it mirrored on R-forge so from your users'
viewpoint its the same as if it were on R-Forge but you can use the
simpler googlecode site.  In that case you might not need to set up
commits on R-Forge since you would do all your commits through
googlecode (depending on how it works) but I have not seen good
documentation on how to do this.


2010/3/27 Uwe Ligges lig...@statistik.tu-dortmund.de:
 From my memory: I guess you need to tell TortoiseSVN to use plink as your
 ssh client. I do not use putty myself hence cannot look into the details
 here.

 Uwe Ligges






 On 27.03.2010 15:12, Christophe Genolini wrote:

 Hi the list,
 I try to use R-Forge for developping a projet. I am using tortoise SVN
 (last version) but I do not manage to Commit. I read the R-Forge user
 Manual and some post on but I do not manage to find the solution. Here
 is what I did:

 1/ I download 'puttygen.exe'. I generate a key (256 bits).
 2/ I save the private key in a file 'private.ppk' on my computer.
 3/ I copy-paste the public key on sourceforge
 ssh-rsa
 B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
 rsa-key-20100327
 4/ I wait two hours.
 5/ On my computer, I run 'pageant.exe'.
 6/ I click on 'Add key'. I load the file 'private.ppk'
 7/ I close 'pageant.exe' (still actif in the task bar).
 8/ I open explorer. I create a directory that is suppose to be the local
 directoy for the projet.
 9/ I right-click on the directory. I open 'SVN checkout'
 10/ In 'URL of repository:', I write :
 'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
 (christophe is my accoung, kml3d is the project)
 And...

 ...nothing happen. No bug, not warning, nothing.

 I try several things: if I do
 'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage
 to download the project. But then, I do not manage to upload some
 modification.

 I also see on some tutorial that we might need putty.exe or plink.exe. I
 download them, but R-Forge user Manual do not mention them.

 Any idea of what goes wrong ?

 Thanks
 Christophe

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

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


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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Uwe Ligges
It is really not hard to set it up. I am using a vanilla ssh (rather 
than putty) and that works fine all the time...


Uwe Ligges


On 27.03.2010 18:31, Gabor Grothendieck wrote:

s getting commits to R-Forge to work from
Windows.  The entire system is really geared to UNIX.  It took me a
couple of days of trial and error (since you have to wait 20 minutes
for each try) before I got it working.  Although I did get it to work,
I ultimately decided to host all my packages on googlecode.
googlecode is extremely easy to use from Windows and does not require
any public/private key, pageant, etc.  e.g.
http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
how to use it then you can probably set up a googlecode site in
literally 5 minutes.

One other possibility.  I think there is a way to host your project on
googlecode but still have it mirrored on R-forge so from your users'
viewpoint its the same as if it were on R-Forge but you can use the
simpler googlecode site.  In that case you might not need to set up
commits on R-Forge since you would do all your commits through
googlecode (depending on how it works) but I have not seen good
documentation on how to do this.



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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Gabor Grothendieck
The worst part is the 20 minute delay which means that if here is
something wrong and you don't know what it is and need to try various
things via trial and error each try takes 20 minutes so its not
surprising that it can be extremely time consuming to set up.  I did
set it up a long time ago so perhaps the situation is better now but
my experience at the time was more like Christophe's.  If the 20
minute turnaround cannot be solved then I think the best solution for
Windows users would be excellent step by step documentation on how to
mirror your repository onto R-Forge from googlecode and elsewhere so
that Windows users can do their commits on googlecode (assuming that
mirroring your repository is possible and is easier than the commit
procedure and does not involve the 20 minute delay).

2010/3/27 Uwe Ligges lig...@statistik.tu-dortmund.de:
 It is really not hard to set it up. I am using a vanilla ssh (rather than
 putty) and that works fine all the time...

 Uwe Ligges


 On 27.03.2010 18:31, Gabor Grothendieck wrote:

 s getting commits to R-Forge to work from
 Windows.  The entire system is really geared to UNIX.  It took me a
 couple of days of trial and error (since you have to wait 20 minutes
 for each try) before I got it working.  Although I did get it to work,
 I ultimately decided to host all my packages on googlecode.
 googlecode is extremely easy to use from Windows and does not require
 any public/private key, pageant, etc.  e.g.
 http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
 how to use it then you can probably set up a googlecode site in
 literally 5 minutes.

 One other possibility.  I think there is a way to host your project on
 googlecode but still have it mirrored on R-forge so from your users'
 viewpoint its the same as if it were on R-Forge but you can use the
 simpler googlecode site.  In that case you might not need to set up
 commits on R-Forge since you would do all your commits through
 googlecode (depending on how it works) but I have not seen good
 documentation on how to do this.



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


[Rd] Installing R-packages in Windows Using Rtools - compilation error when signal.h included in C header

2010-03-27 Thread Naim Rashid
Hi all,

I have been attempting to find a resolution to this problem but could
not to any avail. I am attempting to install an R-package from source
in windows that depends on underlying C-code.  I should mention that
this error is not found when installing this package from source in
Linux or Mac.  To do this I have installed R-tools 2.11 and was
successfully able to use R and basic unix commands from the windows
command prompt.

When I install my package from the windows command prompt with R CMD
INSTALL packagename however, the C files within the source directory
all compiles until it hits a file called cheapcgi.c, where the
following error is given:

gcc -Ic:/R/include    -O3 -Wall  -std=gnu99 -c cheapcgi.c -o cheapcgi.o
cheapcgi.c: In function 'catchSignal':
cheapcgi.c:538: error: 'SIGBUS' undeclared (first use in this function)
cheapcgi.c:538: error: (Each undeclared identifier is reported only once
cheapcgi.c:538: error: for each function it appears in.)
cheapcgi.c:546: error: 'SIGKILL' undeclared (first use in this function)
cheapcgi.c: In function 'initSigHandlers':
cheapcgi.c:558: error: 'SIGBUS' undeclared (first use in this function)
make: *** [cheapcgi.o] Error 1
  ... done
ERROR: compilation failed for package 'zinba'
* removing 'c:/R/library/zinba'

Exploring this error further, I see these variables are defined in the
standard C header file signal.h, and is linked to in cheapcgi.c using

#include signal.h

in the beginning of the file.  Now, the other C files have compiled
successfully before reaching this file, so I know that the MinGW
compiler is at least working.  When checking the mingw/include
directory in the Rtools folder, I do indeed see a file for signal.h,
so it is not missing.

This problem is baffling and I could not find any documents talking
about this issues online.  I do realize that system signals may not
work in windows, but at least the header files for the signal.h should
be found.  I would be greatly appreciative if anyone can shed any
insight on this issue. Again, this is only when installing R packages
in windows using Rtools, not in Mac or Linux.

Thanks very much,
Naim

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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Dirk Eddelbuettel

On 27 March 2010 at 13:50, Gabor Grothendieck wrote:
| The worst part is the 20 minute delay which means that if here is
| something wrong and you don't know what it is and need to try various
| things via trial and error each try takes 20 minutes so its not
| surprising that it can be extremely time consuming to set up.  I did
| set it up a long time ago so perhaps the situation is better now but
| my experience at the time was more like Christophe's.  If the 20
| minute turnaround cannot be solved then I think the best solution for
| Windows users would be excellent step by step documentation on how to
| mirror your repository onto R-Forge from googlecode and elsewhere so
| that Windows users can do their commits on googlecode (assuming that
| mirroring your repository is possible and is easier than the commit
| procedure and does not involve the 20 minute delay).

I think you are being rather unfair here.  These are contributed service
being provided by folks in their extra time that they could be spending for
their own work or research instead. The general rule still is: stop
complaining, and volunteer to provide something that is better (or at least
write the aforementioned step-by-step tutorial).  Otherwise you are just
making noise with no signal whatsoever.

R-Forge is a rocksolid service for hundreds of us, and (at least the folks I
work with) are very appreciative of the service.  So a big Thank You from my
end.

Dirk
 
| 2010/3/27 Uwe Ligges lig...@statistik.tu-dortmund.de:
|  It is really not hard to set it up. I am using a vanilla ssh (rather than
|  putty) and that works fine all the time...
| 
|  Uwe Ligges
| 
| 
|  On 27.03.2010 18:31, Gabor Grothendieck wrote:
| 
|  s getting commits to R-Forge to work from
|  Windows.  The entire system is really geared to UNIX.  It took me a
|  couple of days of trial and error (since you have to wait 20 minutes
|  for each try) before I got it working.  Although I did get it to work,
|  I ultimately decided to host all my packages on googlecode.
|  googlecode is extremely easy to use from Windows and does not require
|  any public/private key, pageant, etc.  e.g.
|  http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
|  how to use it then you can probably set up a googlecode site in
|  literally 5 minutes.
| 
|  One other possibility.  I think there is a way to host your project on
|  googlecode but still have it mirrored on R-forge so from your users'
|  viewpoint its the same as if it were on R-Forge but you can use the
|  simpler googlecode site.  In that case you might not need to set up
|  commits on R-Forge since you would do all your commits through
|  googlecode (depending on how it works) but I have not seen good
|  documentation on how to do this.
| 
| 
| 
| __
| R-devel@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!

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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Henrik Bengtsson
2010/3/27 Christophe Genolini cgeno...@u-paris10.fr:
 Henrik Bengtsson a écrit :

 2010/3/27 hb h...@stat.berkeley.edu:


 On Sat, Mar 27, 2010 at 3:12 PM, Christophe Genolini 
 cgeno...@u-paris10.fr wrote:


 Hi the list,
 I try to use R-Forge for developping a projet. I am using tortoise SVN 
 (last
 version) but I do not manage to Commit. I read the R-Forge user Manual and
 some post on  but I do not manage to find the solution. Here is what I did:

 1/ I download 'puttygen.exe'. I generate a key (256 bits).
 2/ I save the private key in a file 'private.ppk' on my computer.
 3/ I copy-paste the public key on sourceforge
 ssh-rsa
 B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
 rsa-key-20100327
 4/ I wait two hours.
 5/ On my computer, I run 'pageant.exe'.
 6/ I click on 'Add key'. I load the file 'private.ppk'
 7/ I close 'pageant.exe' (still actif in the task bar).
 8/ I open explorer. I create a directory that is suppose to be the local
 directoy for the projet.
 9/ I right-click on the directory. I open 'SVN checkout'
 10/ In 'URL of  repository:', I write :
 'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
 (christophe is my accoung, kml3d is the project)
 And...

 ...nothing happen. No bug, not warning, nothing.

 I try several things: if I do
 'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage to
 download the project. But then, I do not manage to upload some 
 modification.


 All looks ok, but I think you are using the wrong protocol. It should be 
 'svn+ssh' for *commits*, i.e.

 svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d

 which *is* shown at http://r-forge.r-project.org/scm/?group_id=727




 Now, in addition, I configure putty as Uwe advice me. I follow the tutorial 
 http://www.mono-project.com/Putty_and_TortoiseSvn

 Sorry, I missed that you've tried that (I scrolled past it on my small 
 screen).

 - When you generated a key in PUTTYgen, did you enter a passphrase?  I
 think you have to leave that blank.

 - Make sure not to have any newlines/spaces in the key, when you paste
 it, that is, you should have:

 Line 1: ssh-rsa
 Line 2: long key


 On two line ? On R-forge, they say /Make sure there are no line breaks 
 except between keys./

My bad/you're right.  I went back an checked an it's all on one line;
I've got three keys on three lines.


 You can have multiple entries as the above.

 - You need to checkout with the svn+ssh URL, because that it is what
 TortoiseSVN will use for commits (unless you do relocate).  If you
 can checkout using this protocol, you should be able to commit.  Thus,
 focus your troubleshooting on checking out.

 - In the Default Settings PuTTY Configurations, make sure Attempt
 authentication using Pageant is checked under the Connection - SSH
 - Auth panel.


 I did

 - Make sure Pageant lists the key in its dialog.



 It is.

 Does it work?



 No. In putty, I get :
 login as: christophe

 Then a pop up say : Assertion failed!
 Program:...\pageant.exe
 File: ..\sshrsa.c
 Line:793
 ...

Hmm... I don't get that.  It looks wrong.  Google it and you find:

quote
10.7 ‘Internal error’, ‘Internal fault’, ‘Assertion failed’

Any error beginning with the word ‘Internal’ should never occur. If it
does, there is a bug in PuTTY by definition; please see appendix B and
report it to us.

Similarly, any error message starting with ‘Assertion failed’ is a bug
in PuTTY. Please report it to us, and include the exact text from the
error message box.
/quote

URL: 
http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter10.html#errors-internal
Also: 
http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/sshcrcda-assertion-failed.html

What's the PuTTY version do you have?  I have PuTTY v0.60 and it works.

Try to generate a new pair of ssh keys and retry.

If you want to, you can send me a pair of private/public keys that you
generate and I can try it on my r-forge account.

/Henrik


 Then I click ignore

 On putty again :

 Authenticating with public key rsa-key-20100327 from agent
 Access denied
 christo...@kml3d.r-forge.r-project.org's password:
 Linux xmrforge2 2.6.18-xen #1 SMP Fri May 18 16:01:42 BST 2007 x86_64

 The programs included with the Debian GNU/Linux system are free software;
 the exact distribution terms for each program are described in the
 individual files in /usr/share/doc/*/copyright.

 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law.
 Last login: Sat Mar 27 17:56:55 2010 from def92-4-82-225-59-146.fbx.proxad.net
 This is a restricted account.
 You cannot execute anything here.
 Goodbye.



 /Henrik



 /Henrik

 PS. Don't think you need plink, but I might be wrong.



 I also see on some tutorial that we might need putty.exe or plink.exe. I
 download them, but R-Forge user Manual do not mention them.

 Any idea of what goes wrong ?

 Thanks
 Christophe

 __
 R-devel@r

Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Gabor Grothendieck
I wasn't commenting of the overall worth of the system or the efforts
of those involved in it but your experience is with Linux rather than
Windows and I don't think you understand the problems that Windows
users have with this.

The poster may have believed its uniquely his problem but in fact
others have had very similar problems in dealing with this. What is
the purpose of this list if its not to share experiences to help one
another?  I think the useful suggestions I made could potentially save
someone literally days of frustration and my other suggestions could
possibly overcome these problems in part making the system more useful
so I don't agree that this is mere complaining.

On Sat, Mar 27, 2010 at 2:15 PM, Dirk Eddelbuettel e...@debian.org wrote:

 On 27 March 2010 at 13:50, Gabor Grothendieck wrote:
 | The worst part is the 20 minute delay which means that if here is
 | something wrong and you don't know what it is and need to try various
 | things via trial and error each try takes 20 minutes so its not
 | surprising that it can be extremely time consuming to set up.  I did
 | set it up a long time ago so perhaps the situation is better now but
 | my experience at the time was more like Christophe's.  If the 20
 | minute turnaround cannot be solved then I think the best solution for
 | Windows users would be excellent step by step documentation on how to
 | mirror your repository onto R-Forge from googlecode and elsewhere so
 | that Windows users can do their commits on googlecode (assuming that
 | mirroring your repository is possible and is easier than the commit
 | procedure and does not involve the 20 minute delay).

 I think you are being rather unfair here.  These are contributed service
 being provided by folks in their extra time that they could be spending for
 their own work or research instead. The general rule still is: stop
 complaining, and volunteer to provide something that is better (or at least
 write the aforementioned step-by-step tutorial).  Otherwise you are just
 making noise with no signal whatsoever.

 R-Forge is a rocksolid service for hundreds of us, and (at least the folks I
 work with) are very appreciative of the service.  So a big Thank You from my
 end.

 Dirk

 | 2010/3/27 Uwe Ligges lig...@statistik.tu-dortmund.de:
 |  It is really not hard to set it up. I am using a vanilla ssh (rather than
 |  putty) and that works fine all the time...
 | 
 |  Uwe Ligges
 | 
 | 
 |  On 27.03.2010 18:31, Gabor Grothendieck wrote:
 | 
 |  s getting commits to R-Forge to work from
 |  Windows.  The entire system is really geared to UNIX.  It took me a
 |  couple of days of trial and error (since you have to wait 20 minutes
 |  for each try) before I got it working.  Although I did get it to work,
 |  I ultimately decided to host all my packages on googlecode.
 |  googlecode is extremely easy to use from Windows and does not require
 |  any public/private key, pageant, etc.  e.g.
 |  http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
 |  how to use it then you can probably set up a googlecode site in
 |  literally 5 minutes.
 | 
 |  One other possibility.  I think there is a way to host your project on
 |  googlecode but still have it mirrored on R-forge so from your users'
 |  viewpoint its the same as if it were on R-Forge but you can use the
 |  simpler googlecode site.  In that case you might not need to set up
 |  commits on R-Forge since you would do all your commits through
 |  googlecode (depending on how it works) but I have not seen good
 |  documentation on how to do this.
 | 
 | 
 |
 | __
 | R-devel@r-project.org mailing list
 | https://stat.ethz.ch/mailman/listinfo/r-devel

 --
  Registration is open for the 2nd International conference R / Finance 2010
  See http://www.RinFinance.com for details, and see you in Chicago in April!


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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread Henrik Bengtsson
BTW, it may indeed be that you have to wait (more than 2-3 hours)
before things are updated on the r-forge servers, cf.

Thread 'FYI: New members must wait hours to commit' on 2009-12-03
https://r-forge.r-project.org/forum/forum.php?thread_id=1966forum_id=78

/Henrik

On Sat, Mar 27, 2010 at 7:30 PM, Henrik Bengtsson h...@stat.berkeley.edu 
wrote:
 2010/3/27 Christophe Genolini cgeno...@u-paris10.fr:
 Henrik Bengtsson a écrit :

 2010/3/27 hb h...@stat.berkeley.edu:


 On Sat, Mar 27, 2010 at 3:12 PM, Christophe Genolini 
 cgeno...@u-paris10.fr wrote:


 Hi the list,
 I try to use R-Forge for developping a projet. I am using tortoise SVN 
 (last
 version) but I do not manage to Commit. I read the R-Forge user Manual and
 some post on  but I do not manage to find the solution. Here is what I 
 did:

 1/ I download 'puttygen.exe'. I generate a key (256 bits).
 2/ I save the private key in a file 'private.ppk' on my computer.
 3/ I copy-paste the public key on sourceforge
 ssh-rsa
 B3NzaC1yc2EBJQAAACEAobwycGGZrMZ39i7Vtrdk3ahN1hVw/tPoiShJGk1xjRs=
 rsa-key-20100327
 4/ I wait two hours.
 5/ On my computer, I run 'pageant.exe'.
 6/ I click on 'Add key'. I load the file 'private.ppk'
 7/ I close 'pageant.exe' (still actif in the task bar).
 8/ I open explorer. I create a directory that is suppose to be the local
 directoy for the projet.
 9/ I right-click on the directory. I open 'SVN checkout'
 10/ In 'URL of  repository:', I write :
 'svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d'
 (christophe is my accoung, kml3d is the project)
 And...

 ...nothing happen. No bug, not warning, nothing.

 I try several things: if I do
 'svn://christo...@svn.r-forge.r-project.org/svnroot/kml3d', I do manage to
 download the project. But then, I do not manage to upload some 
 modification.


 All looks ok, but I think you are using the wrong protocol. It should be 
 'svn+ssh' for *commits*, i.e.

 svn+ssh://christo...@svn.r-forge.r-project.org/svnroot/kml3d

 which *is* shown at http://r-forge.r-project.org/scm/?group_id=727




 Now, in addition, I configure putty as Uwe advice me. I follow the tutorial 
 http://www.mono-project.com/Putty_and_TortoiseSvn

 Sorry, I missed that you've tried that (I scrolled past it on my small 
 screen).

 - When you generated a key in PUTTYgen, did you enter a passphrase?  I
 think you have to leave that blank.

 - Make sure not to have any newlines/spaces in the key, when you paste
 it, that is, you should have:

 Line 1: ssh-rsa
 Line 2: long key


 On two line ? On R-forge, they say /Make sure there are no line breaks 
 except between keys./

 My bad/you're right.  I went back an checked an it's all on one line;
 I've got three keys on three lines.


 You can have multiple entries as the above.

 - You need to checkout with the svn+ssh URL, because that it is what
 TortoiseSVN will use for commits (unless you do relocate).  If you
 can checkout using this protocol, you should be able to commit.  Thus,
 focus your troubleshooting on checking out.

 - In the Default Settings PuTTY Configurations, make sure Attempt
 authentication using Pageant is checked under the Connection - SSH
 - Auth panel.


 I did

 - Make sure Pageant lists the key in its dialog.



 It is.

 Does it work?



 No. In putty, I get :
 login as: christophe

 Then a pop up say : Assertion failed!
 Program:...\pageant.exe
 File: ..\sshrsa.c
 Line:793
 ...

 Hmm... I don't get that.  It looks wrong.  Google it and you find:

 quote
 10.7 ‘Internal error’, ‘Internal fault’, ‘Assertion failed’

 Any error beginning with the word ‘Internal’ should never occur. If it
 does, there is a bug in PuTTY by definition; please see appendix B and
 report it to us.

 Similarly, any error message starting with ‘Assertion failed’ is a bug
 in PuTTY. Please report it to us, and include the exact text from the
 error message box.
 /quote

 URL: 
 http://the.earth.li/~sgtatham/putty/0.60/htmldoc/Chapter10.html#errors-internal
 Also: 
 http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/sshcrcda-assertion-failed.html

 What's the PuTTY version do you have?  I have PuTTY v0.60 and it works.

 Try to generate a new pair of ssh keys and retry.

 If you want to, you can send me a pair of private/public keys that you
 generate and I can try it on my r-forge account.

 /Henrik


 Then I click ignore

 On putty again :

 Authenticating with public key rsa-key-20100327 from agent
 Access denied
 christo...@kml3d.r-forge.r-project.org's password:
 Linux xmrforge2 2.6.18-xen #1 SMP Fri May 18 16:01:42 BST 2007 x86_64

 The programs included with the Debian GNU/Linux system are free software;
 the exact distribution terms for each program are described in the
 individual files in /usr/share/doc/*/copyright.

 Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
 permitted by applicable law.
 Last login: Sat Mar 27 17:56:55 2010 from 
 def92-4-82-225-59-146.fbx.proxad.net
 This is a restricted account.
 You

Re: [Rd] update.packages(1)

2010-03-27 Thread Duncan Murdoch

On 25/03/2010 3:16 PM, Arni Magnusson wrote:

I'm relaying a question from my institute's sysadmin:

Would it be possible to modify update.packages() and related functions so 
that 'lib.loc' accepts integer values to specify a library from the 
.libPaths() vector?


Many Linux users want to update all user packages (inside the R_LIBS_USER 
directory, e.g. ~/r/library) and none of the system packages (inside the 
/usr directory, e.g. /usr/lib64/R/library), because they don't have write 
privileges to update the system packages.


Currently, this can be done by pressing 'y RET' for all the user packages 
and 'RET' for all the system packages. This hard work and careful reading 
when there dozens of packages. Another way is to run


   update.packages(Sys.getenv(R_LIBS_USER))

or:

   update.packages(.libPaths()[1])


You could also save some work by putting ask=FALSE, or ask=graphics in 
as another argument.  But isn't it easy enough to write your own 
function as a wrapper to update.packages, suiting your own local 
conventions?   It seems like a bad idea to make update.packages too 
friendly, when there are several different friendly front-ends for it 
already (e.g. the menu entries in Windows or MacOS GUIs).



But it would be nicer for the user to type

   update.packages(1)

using a 'pos' like notation to indicate the first element of the 
.libPaths() vector.


---

A separate but related issue is that it would be nice if the R_LIBS_USER 
library would be the first library by default. Currently, my sysadmin must 
use Rprofile.site to shuffle the .libPaths() to make R_LIBS_USER first, 
which seems like a sensible default when it comes to install.packages() 
and remove.packages().


This is R version 2.10.1 (2009-12-14) on x86_64-redhat-linux-gnu (Fedora 
11).


I didn't write it, but I suspect the current behaviour was intentional. 
 Without it, it would be hard to put the user library last, since 
.libPaths() adds things at the front.  Now you have a choice:  use the 
R_LIBS_USER environment variable to put it last, use a line in your 
Rprofile.site file to put something first.


Duncan Murdoch

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


Re: [Rd] update.packages(1)

2010-03-27 Thread Seth Falcon
On 3/27/10 1:43 PM, Duncan Murdoch wrote:
 On 25/03/2010 3:16 PM, Arni Magnusson wrote:
 I'm relaying a question from my institute's sysadmin:

 Would it be possible to modify update.packages() and related functions
 so that 'lib.loc' accepts integer values to specify a library from the
 .libPaths() vector?

 Many Linux users want to update all user packages (inside the
 R_LIBS_USER directory, e.g. ~/r/library) and none of the system
 packages (inside the /usr directory, e.g. /usr/lib64/R/library),
 because they don't have write privileges to update the system packages.

 Currently, this can be done by pressing 'y RET' for all the user
 packages and 'RET' for all the system packages. This hard work and
 careful reading when there dozens of packages. Another way is to run

update.packages(Sys.getenv(R_LIBS_USER))

 or:

update.packages(.libPaths()[1])
 
 You could also save some work by putting ask=FALSE, or ask=graphics in
 as another argument.  But isn't it easy enough to write your own
 function as a wrapper to update.packages, suiting your own local
 conventions?   It seems like a bad idea to make update.packages too
 friendly, when there are several different friendly front-ends for it
 already (e.g. the menu entries in Windows or MacOS GUIs).
 
 But it would be nicer for the user to type

update.packages(1)

 using a 'pos' like notation to indicate the first element of the
 .libPaths() vector.

 ---

 A separate but related issue is that it would be nice if the
 R_LIBS_USER library would be the first library by default. Currently,
 my sysadmin must use Rprofile.site to shuffle the .libPaths() to make
 R_LIBS_USER first, which seems like a sensible default when it comes
 to install.packages() and remove.packages().

I'm confused.  AFAICT, R_LIBS_USER _is_ put first.  Following the advice
in the Admin manual, I created a directory matching the default value of
R_LIBS_USER (Sys.getenv(R_LIBS_USER) to see it).  Then when I start R,
I get:

 .libPaths()
[1] /home/sfalcon/R/x86_64-unknown-linux-gnu-library/2.11
[2] /home/sfalcon/build/rd/library

Isn't that what you want?

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


Re: [Rd] update.packages(1)

2010-03-27 Thread Duncan Murdoch

On 27/03/2010 4:48 PM, Seth Falcon wrote:

On 3/27/10 1:43 PM, Duncan Murdoch wrote:

On 25/03/2010 3:16 PM, Arni Magnusson wrote:

I'm relaying a question from my institute's sysadmin:

Would it be possible to modify update.packages() and related functions
so that 'lib.loc' accepts integer values to specify a library from the
.libPaths() vector?

Many Linux users want to update all user packages (inside the
R_LIBS_USER directory, e.g. ~/r/library) and none of the system
packages (inside the /usr directory, e.g. /usr/lib64/R/library),
because they don't have write privileges to update the system packages.

Currently, this can be done by pressing 'y RET' for all the user
packages and 'RET' for all the system packages. This hard work and
careful reading when there dozens of packages. Another way is to run

   update.packages(Sys.getenv(R_LIBS_USER))

or:

   update.packages(.libPaths()[1])

You could also save some work by putting ask=FALSE, or ask=graphics in
as another argument.  But isn't it easy enough to write your own
function as a wrapper to update.packages, suiting your own local
conventions?   It seems like a bad idea to make update.packages too
friendly, when there are several different friendly front-ends for it
already (e.g. the menu entries in Windows or MacOS GUIs).


But it would be nicer for the user to type

   update.packages(1)

using a 'pos' like notation to indicate the first element of the
.libPaths() vector.

---

A separate but related issue is that it would be nice if the
R_LIBS_USER library would be the first library by default. Currently,
my sysadmin must use Rprofile.site to shuffle the .libPaths() to make
R_LIBS_USER first, which seems like a sensible default when it comes
to install.packages() and remove.packages().


I'm confused.  AFAICT, R_LIBS_USER _is_ put first.  Following the advice
in the Admin manual, I created a directory matching the default value of
R_LIBS_USER (Sys.getenv(R_LIBS_USER) to see it).  Then when I start R,
I get:


.libPaths()

[1] /home/sfalcon/R/x86_64-unknown-linux-gnu-library/2.11
[2] /home/sfalcon/build/rd/library

Isn't that what you want?


I didn't try it, I just read the documentation (in ?.libPaths).  As I 
read it it says the order is


R_LIBS, R_LIBS_USER, .Library.site, .Library

and some of those components can be missing.

So another way to put the user libs first is to specify the site libs in 
.Library.site rather than in the environment variable.


Duncan Murdoch

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


Re: [Rd] Using SVN + SSH on windows

2010-03-27 Thread David Scott

Uwe Ligges wrote:
It is really not hard to set it up. I am using a vanilla ssh (rather 
than putty) and that works fine all the time...


Uwe Ligges



Ditto here. I am using ssh non commercial version with tortoise on 
Vista, and I don't recall any problems setting it up. R-forge works 
perfectly fine with windows and tortoise in my experience.


Is your putty/ssh working? Can you access other machines with it? I do 
recall ssh can be a bit fussy.


David Scott




On 27.03.2010 18:31, Gabor Grothendieck wrote:

s getting commits to R-Forge to work from
Windows.  The entire system is really geared to UNIX.  It took me a
couple of days of trial and error (since you have to wait 20 minutes
for each try) before I got it working.  Although I did get it to work,
I ultimately decided to host all my packages on googlecode.
googlecode is extremely easy to use from Windows and does not require
any public/private key, pageant, etc.  e.g.
http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
how to use it then you can probably set up a googlecode site in
literally 5 minutes.

One other possibility.  I think there is a way to host your project on
googlecode but still have it mirrored on R-forge so from your users'
viewpoint its the same as if it were on R-Forge but you can use the
simpler googlecode site.  In that case you might not need to set up
commits on R-Forge since you would do all your commits through
googlecode (depending on how it works) but I have not seen good
documentation on how to do this.



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



--
_
David Scott Department of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:  d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics

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


Re: [Rd] : Operator overloading for custom classes

2010-03-27 Thread Chidambaram Annamalai
Thank you for replying! But I have since figured out how to perform the
operator overloading after reading the Not so short tutorial to S4 classes
and a bit of Robert Gentleman's deceptively titled book on R.

(I had mistakenly posted to r-devel earlier and when I posted to r-help
subsequently I got a pointer to the resources on rwiki that dealt with OOP)

Like you say, many already existing packages inside of R use operator
overloading. For instance I later observed that the + operator was
overloaded [by running the command methods('+')] for the Date and POSIXt
classes. I will have to redefine the generic function + for my classes to
get the output I want.

Regards,
Chillu

On Sat, Mar 27, 2010 at 3:46 AM, Peter Ruckdeschel peter.ruckdesc...@web.de
 wrote:

 
  I need some help to get some of the object orientation, specifically the
  methods that overload the basic arithmetic operations, from sample C++
  code to R. I don't have experience with such advanced language features
  inside of R. So I was wondering if some of you could help me out in this
  regard.
 
  I have written a simple demonstration of a forward mode automatic
  differentiator in C++ and it is currently hosted on github:
  http://github.com/quantumelixir/ad-demo/blob/master/simple.cpp. It uses
  simple operator overloading techniques to modify the meaning of the
  basic arithmetic operations (+, -, *, /) for the derivative type Dual
  number class that I have defined. Could you show me how this could be
  equivalently done in R? I want to know how to define custom classes and
  define the meaning of arithmetic for them.
 
  I had checked for operator overloading in R but could only find the
  equivalence of a + b and '+'(a, b) in the R language definition. Could
  you show how I could extend the simple object oriented-ness in the C++
  code neatly to R?
 
  Thanks a bunch!
  Chillu
 
[[alternative HTML version deleted]]
 

 First of all you should read about S4 classes, in particular
 the books of John Chambers should be helpful ;-)
 (others on this list might point you to further sources).

 The key is to define S4 classes for your operands
 [i.e; if I have understood correctly you would implement
 your Dual number class as S4 class].

 Then you would define new methods by setMethod().

 Not sure whether this gives you the indications you look for,
 but we have overloaded arithmetic operators to act on distribution
 classes in package distr (cf CRAN, developped under r-forge).
 You might want to look at the code in NormalDistribution.R resp.
 ContDistribution.R

 HTH Peter Ruckdeschel

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


[[alternative HTML version deleted]]

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


Re: [Rd] Suggestion: Not having to export .conflicts.OK in name spaces

2010-03-27 Thread Henrik Bengtsson
Hi.

On Mon, Mar 22, 2010 at 5:36 PM, Seth Falcon s...@userprimary.net wrote:
 On 3/22/10 3:57 AM, Martin Maechler wrote:

 SF == Seth Falcons...@userprimary.net
     on Fri, 19 Mar 2010 13:47:17 -0700 writes:

     SF  On 3/17/10 9:11 AM, Henrik Bengtsson wrote:
       Currently library() and attach() fail to locate an
       existing '.conflicts.OK' in a package wit name space,
       unless it is exported.  Since there should be little
       interest in exporting '.conflicts.OK' otherwise, one may
       argue that those methods should look for '.conflicts.OK'
       even if it is not exported.

     SF  I guess I agree that there is no real value in forcing
     SF  .conflicts.OK to be exported.
 so do I.

 So I guess we agree that Henrik's patch would be worth applying.

 @Henrik: if you resend your patch with the additions for attach, I will see
 about putting it in.

When looking more carefully at base::attach(), I see that there is
nothing to do, because attach() takes a data.frame, a list, an
environment, NULL, or a file saved using base::save().  None of these
can have a name space.

The scenario I was worrying about was when you attach() the
environment of a package with a namespace, e.g.

envir - as.environment(package:graphics);
envir2 - attach(envir, name=foo);
ls(envir=envir2, all.names=TRUE);

but to the best of my understanding it is only exported objects that
are attached, i.e. if .conflicts.OK is not exported by the package,
then it won't be attached and hence not exist either way.  Is that
correct?

envir - as.environment(package:R.utils);
envir2 - attach(envir, name=foo);
ls(envir=envir2, all.names=TRUE);



     SF  OTOH, this seems like a dubious feature to begin.  When
     SF  is it a good idea to use it?

 in cases, the package author thinks (s)he knows what (s)he is
 doing;
 e.g. in the case of Matrix, I could argue that I know about the
 current conflicts, and I would *not* want the users of my
 package be intimidated by warnings about maskings...

 I can't say that this convinces me that .conflicts.OK is OK.  Are there
 package authors who realize they do not know what they are doing enough to
 keep the warning messages :-P

I define throw.default() in R.methodsS3:

 R.methodsS3::throw.default
function (...)
{
stop(...)
}
environment: namespace:R.methodsS3

In R.oo, which loads R.methodsS3, I override this with:

 R.oo::throw.default
function (...)
{
throw(Exception(...))
}
environment: namespace:R.oo

The Exception class is defined in R.oo.  If someone loads R.methodsS3
alone, you get a throw() method.  Someone loading R.oo will get the a
throw() that is backward compatible but with some extra bells and
whistles recording the strack trace etc.  This is an intended design.

So when I load R.oo, I don't want the warning of overloading throw()
in R.methodsS3.  Is there an alternative for me?

Ideally, there should be a way to specify which objects are ok,
instead of all or none.

Thanks

Henrik


 + seth

 --
 Seth Falcon | @sfalcon | http://userprimary.net/

 __
 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