[R-sig-ins] Hacking on the ChainLadder package?
Romain Francois
romain.francois at dbmail.com
Wed Oct 21 08:14:52 CEST 2009
On 10/21/2009 05:40 AM, Ben wrote:
>
> Hi all,
>
> I'm new to R but would like to work on (and hopefully contribute
> usefully to) Markus Gesmann's excellent ChainLadder package. However,
> I don't have a development loop in place, so I'd appreciate some
> guidance on how best to work on this. I have the actual package
> installed in
>
> ~/R/x86_64-pc-linux-gnu-library/2.8/ChainLadder
>
> and I have the code checked out from subversion in:
>
> ~/prog/chainladder-read-only
Hi,
what you checked out is the source of the package, this is really
different from the compiled package you'll find in
/R/x86_64-pc-linux-gnu-library/2.8/ChainLadder which is the kind of
structure "library" expects.
The best way is to recompile the package after your change, i.e.
cd prog
R CMD build chainladder-read-only
R CMD INSTALL ChainLadder*.tar.gz
--library=~/R/x86_64-pc-linux-gnu-library/2.8
But you can also just source the file you modified, something like :
R> chainladder.dir <- "~/prog/chainladder-read-only/R"
R> source( file.path( chainladder.dir, "Triangles.R" ) )
Romain
> I'd like some way of editing the files,
> e.g. ~/prog/chainladder-read-only/R/Triangles.R and testing it without
> having to make a whole new package and install it. However, I can't
> seem to load the package from my subversion directory:
>
> > library(ChainLadder, lib="~/prog")
> Error in library(ChainLadder, lib = "~/prog/chainladder-read-only") :
> there is no package called 'ChainLadder'
>
> if I make the symbolic link "ChainLadder" to "chainladder-read-only" I
> get:
>
> > library(ChainLadder, lib="~/prog")
> Error in library(ChainLadder, lib = "~/prog") :
> 'ChainLadder' is not a valid package -- installed< 2.0.0?
>
> which I don't know what it means and google isn't super-helpful. I'm
> also not even sure I'm on the right track.
>
> So anyway, I'd really appreciate it if Markus or another ChainLadder
> or R guru has some tips on how best to use subversion and R. If it
> matters, I'm using emacs/ESS as my editor.
>
> Thank you very much,
>
--
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/BcPw : celebrating R commit #50000
|- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc
`- http://tr.im/yw8E : New R package : sos
More information about the R-SIG-insurance
mailing list