From smyth at wehi.EDU.AU  Tue Jul 10 07:26:29 2012
From: smyth at wehi.EDU.AU (Gordon K Smyth)
Date: Tue, 10 Jul 2012 15:26:29 +1000 (AUS Eastern Standard Time)
Subject: [Rd] Using a function from splines.c in our package
In-Reply-To: <alpine.LFD.2.02.1207091037400.22139@gannet.stats.ox.ac.uk>
References: <Pine.WNT.4.64.1207091716340.5512@PC765.wehi.edu.au>
	<alpine.LFD.2.02.1207091037400.22139@gannet.stats.ox.ac.uk>
Message-ID: <Pine.WNT.4.64.1207101511530.416@PC765.wehi.edu.au>

Thanks.  Our package has LGPL (>= 2) licence, so we'll copy with header 
and proper acknowledgements.

Gordon

On Mon, 9 Jul 2012, Prof Brian Ripley wrote:

> On Mon, 9 Jul 2012, Gordon K Smyth wrote:
>
>> Dear all,
>> 
>> I'm writing to ask for advice as to best practice.  A PhD student working 
>> with me is writing C++ code that we hope to make public as src code in our 
>> Bioconductor package edgeR.  He wants to call the function fmm_spline, 
>> which is part of the source code for the stats package
>> 
>> http://svn.r-project.org/R/trunk/src/library/stats/src/splines.c,
>> 
>> from his C++ code.  This function isn't one of the entry points for C code 
>> documented in Chapter 6 of the "Writing R extensions" manual.
>
> None of those are in a package.
>
>> We haven't figured out a way to call the fmm_spline function directly from 
>> our C++ code.  Is there a way that we have missed?
>
> Not a very portable way, but there are some ideas in 'Writing R Extensions'. 
> I don't think they are enough for a CRAN or BioC package, though.
>
>> Can we simply copy the fmm_spline function into our C++ code and declare 
>> where we got it from?  Should we include the license declaration from the 
>> header of splines.c?  Anything else we need to do satisfying copyright and 
>> be good citizens?
>
> If your package has a compatible licence, you can (and you must include the 
> whole header when you copy).   CRAN's policies say that when you copy code 
> from elsewhere you must include that code's authors in the Authors field of 
> your package, and that clearly is good practice.
>
>> Thanks a lot
>> Gordon
>> 
>> ---------------------------------------------
>> Professor Gordon K Smyth,
>> Bioinformatics Division,
>> Walter and Eliza Hall Institute of Medical Research,
>> 1G Royal Parade, Parkville, Vic 3052, Australia.
>> Tel: (03) 9345 2326, Fax (03) 9347 0852,
>> http://www.statsci.org/smyth
>> 
>
> -- 
> Brian D. Ripley,                  ripley at 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, UK                Fax:  +44 1865 272595
>

______________________________________________________________________
The information in this email is confidential and intend...{{dropped:4}}



[Rd] Using a function from splines.c in our package
Gordon K Smyth