Taking code from packages

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Taking code from packages

Ales Ziberna
Hello!

I am currently in the process of creating (my first) package, which (when
ready) I intend to publish to CRAN. In the process of creating this package
I have taken some code form existing packages. I have actually copied parts
of functions in to new functions. This code is usually something very basic
such as Rand index. What is the proper procedure for this?

Since most of R (and also the packages I have taken code form) is published
under GPL, I think this should be OK. However I do not know if:
1. I should still ask authors of the packages for permission or at
least notify them.
2. Ad references to the functions (and packages) from which I had taken
the code or only to the references they use.

What about regarding code that was sent to the list, usually as a response
to one of my problems. I assume that in this case it is best to consult the
author?

Any comments and opinions are very welcomed!

Best regards,
Ales Ziberna

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Taking code from packages

Duncan Murdoch
On 1/13/2006 2:04 AM, Ales Ziberna wrote:

> Hello!
>
> I am currently in the process of creating (my first) package, which (when
> ready) I intend to publish to CRAN. In the process of creating this package
> I have taken some code form existing packages. I have actually copied parts
> of functions in to new functions. This code is usually something very basic
> such as Rand index. What is the proper procedure for this?
>
> Since most of R (and also the packages I have taken code form) is published
> under GPL, I think this should be OK. However I do not know if:
> 1. I should still ask authors of the packages for permission or at
> least notify them.

It is polite to notify them.

> 2. Ad references to the functions (and packages) from which I had taken
> the code or only to the references they use.

The GPL requires that you maintain their copyright notices.  You have
the right to use their work, the GPL doesn't give you ownership of it.
The usual way to do this is to leave their copyright notice intact, and
add your own if you have made modifications.

An alternative which is usually (but not always) better is to say that
your package depends on theirs, and then just use their functions.  The
advantage is that it avoids any of the above mixed copyright issues, and
it makes sure that when the author fixes a bug, you benefit too.  The
disadvantage is that it makes your package dependent on theirs, so if
changes are needed in it for some future version of R, you'll have to
wait for the other maintainer to do them (or copy their code at that point).

(I'm a little sensitive about dependencies now, since the LaTeX seminar
template I've used a few times no longer works.  It depends on too many
LaTeX packages, and someone, somewhere has introduced incompatibilities
in them.  Seems like I'll be forced to use Powerpoint or Impress.)

Duncan Murdoch

>
> What about regarding code that was sent to the list, usually as a response
> to one of my problems. I assume that in this case it is best to consult the
> author?

> Any comments and opinions are very welcomed!
>
> Best regards,
> Ales Ziberna
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Taking code from packages

Ales Ziberna
First thank you for you reply!



First let me assure you that I did not think or intent to just use their
code and use GPL as an excuse.



Although I would like to just make my package dependant on theirs and use
their functions that is not possible. The main reason is that I do not want
to use the whole functions, but just parts of it. For example, I only need
one statistics, while their function computes several. Since I call my
function several thousand times, I want to make it as fast as possible.



I am also modified (although only slightly) the functions, I am a little
worried about naming them as sole authors of the function, since I do not
want to make them responsible for any mistakes I have made.



What I was thinking of doing is:

  1.. Notify the original authors!
  2.. In the Author (s) section of the function help, I would write "Their
name (Modifications made by My Name").
  3.. Use the same license (GPL 2) as they do.

I did not intent to write them as the package authors, since their code
represent a very small part of the whole package.



How does that sound?



Best regards,

Ales Ziberna



P.S.: I did not find any other special copyright notices.





----- Original Message -----
From: "Duncan Murdoch" <[hidden email]>
To: "Ales Ziberna" <[hidden email]>
Cc: <[hidden email]>
Sent: Friday, January 13, 2006 1:46 PM
Subject: Re: [R] Taking code from packages


On 1/13/2006 2:04 AM, Ales Ziberna wrote:

> Hello!
>
> I am currently in the process of creating (my first) package, which (when
> ready) I intend to publish to CRAN. In the process of creating this
> package
> I have taken some code form existing packages. I have actually copied
> parts
> of functions in to new functions. This code is usually something very
> basic
> such as Rand index. What is the proper procedure for this?
>
> Since most of R (and also the packages I have taken code form) is
> published
> under GPL, I think this should be OK. However I do not know if:
> 1. I should still ask authors of the packages for permission or at
> least notify them.

It is polite to notify them.

> 2. Ad references to the functions (and packages) from which I had taken
> the code or only to the references they use.

The GPL requires that you maintain their copyright notices.  You have
the right to use their work, the GPL doesn't give you ownership of it.
The usual way to do this is to leave their copyright notice intact, and
add your own if you have made modifications.

An alternative which is usually (but not always) better is to say that
your package depends on theirs, and then just use their functions.  The
advantage is that it avoids any of the above mixed copyright issues, and
it makes sure that when the author fixes a bug, you benefit too.  The
disadvantage is that it makes your package dependent on theirs, so if
changes are needed in it for some future version of R, you'll have to
wait for the other maintainer to do them (or copy their code at that point).

(I'm a little sensitive about dependencies now, since the LaTeX seminar
template I've used a few times no longer works.  It depends on too many
LaTeX packages, and someone, somewhere has introduced incompatibilities
in them.  Seems like I'll be forced to use Powerpoint or Impress.)

Duncan Murdoch

>
> What about regarding code that was sent to the list, usually as a response
> to one of my problems. I assume that in this case it is best to consult
> the
> author?

> Any comments and opinions are very welcomed!
>
> Best regards,
> Ales Ziberna
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Taking code from packages

Gabor Grothendieck
In reply to this post by Ales Ziberna
I usually place in my mypackage-package.Rd file a pointer
to the existence of a THANKS file and then put the THANKS
file in the inst directory (which gets copied to the top level
directory by the build tools during the build).  For example,
after installing dyn try:

   library(dyn)
   package?dyn

for instructions on accessing the THANKS file from within R.

On 1/13/06, Ales Ziberna <[hidden email]> wrote:

> Hello!
>
> I am currently in the process of creating (my first) package, which (when
> ready) I intend to publish to CRAN. In the process of creating this package
> I have taken some code form existing packages. I have actually copied parts
> of functions in to new functions. This code is usually something very basic
> such as Rand index. What is the proper procedure for this?
>
> Since most of R (and also the packages I have taken code form) is published
> under GPL, I think this should be OK. However I do not know if:
> 1.      I should still ask authors of the packages for permission or at
> least notify them.
> 2.      Ad references to the functions (and packages) from which I had taken
> the code or only to the references they use.
>
> What about regarding code that was sent to the list, usually as a response
> to one of my problems. I assume that in this case it is best to consult the
> author?
>
> Any comments and opinions are very welcomed!
>
> Best regards,
> Ales Ziberna
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Taking code from packages

jgentry
In reply to this post by Ales Ziberna

On Fri, 13 Jan 2006, Ales Ziberna wrote:
> I am currently in the process of creating (my first) package, which (when
> ready) I intend to publish to CRAN. In the process of creating this package
> I have taken some code form existing packages. I have actually copied parts
> of functions in to new functions. This code is usually something very basic
> such as Rand index. What is the proper procedure for this?

Why not simply specify that their package is a dependency and use their
code directly?

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Taking code from packages

Gabor Grothendieck
In reply to this post by Ales Ziberna
On 1/13/06, Ales Ziberna <[hidden email]> wrote:

> First thank you for you reply!
>
>
>
> First let me assure you that I did not think or intent to just use their
> code and use GPL as an excuse.
>
>
>
> Although I would like to just make my package dependant on theirs and use
> their functions that is not possible. The main reason is that I do not want
> to use the whole functions, but just parts of it. For example, I only need
> one statistics, while their function computes several. Since I call my
> function several thousand times, I want to make it as fast as possible.

You might want to time the difference just in case.    Predicting performance
is notoriously difficult to do.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: Taking code from packages

Prof Brian Ripley
In reply to this post by Ales Ziberna
The thing that is most important and has not been mentioned is to ensure
that modified functions have a changed name.

People have taken my code without consulting me, changed what it did and
put it up in a package with the original name (and no indication that I
was the author), and then quoted GPL at me when I complained.  So this may
perhaps help you understand where some of your answers are coming from.

I would suggest adding to your suggested documentation the exact source
you used (it makes it easier to find out if that had been updated later).

R itself borrows software from other packages, and you will see some
examples of how it is referenced in various places including COPYRIGHTS.
In retrospect we should have been more careful to rename things, e.g.
entry points in conpiled code, even if we made no changes as the original
author might want to use his current versions with R.


On Fri, 13 Jan 2006, Ales Ziberna wrote:

> First thank you for you reply!
>
>
>
> First let me assure you that I did not think or intent to just use their
> code and use GPL as an excuse.
>
>
>
> Although I would like to just make my package dependant on theirs and use
> their functions that is not possible. The main reason is that I do not want
> to use the whole functions, but just parts of it. For example, I only need
> one statistics, while their function computes several. Since I call my
> function several thousand times, I want to make it as fast as possible.
>
>
>
> I am also modified (although only slightly) the functions, I am a little
> worried about naming them as sole authors of the function, since I do not
> want to make them responsible for any mistakes I have made.
>
>
>
> What I was thinking of doing is:
>
>  1.. Notify the original authors!
>  2.. In the Author (s) section of the function help, I would write "Their
> name (Modifications made by My Name").
>  3.. Use the same license (GPL 2) as they do.
>
> I did not intent to write them as the package authors, since their code
> represent a very small part of the whole package.
>
>
>
> How does that sound?
>
>
>
> Best regards,
>
> Ales Ziberna
>
>
>
> P.S.: I did not find any other special copyright notices.
>
>
>
>
>
> ----- Original Message -----
> From: "Duncan Murdoch" <[hidden email]>
> To: "Ales Ziberna" <[hidden email]>
> Cc: <[hidden email]>
> Sent: Friday, January 13, 2006 1:46 PM
> Subject: Re: [R] Taking code from packages
>
>
> On 1/13/2006 2:04 AM, Ales Ziberna wrote:
>> Hello!
>>
>> I am currently in the process of creating (my first) package, which (when
>> ready) I intend to publish to CRAN. In the process of creating this
>> package
>> I have taken some code form existing packages. I have actually copied
>> parts
>> of functions in to new functions. This code is usually something very
>> basic
>> such as Rand index. What is the proper procedure for this?
>>
>> Since most of R (and also the packages I have taken code form) is
>> published
>> under GPL, I think this should be OK. However I do not know if:
>> 1. I should still ask authors of the packages for permission or at
>> least notify them.
>
> It is polite to notify them.
>
>> 2. Ad references to the functions (and packages) from which I had taken
>> the code or only to the references they use.
>
> The GPL requires that you maintain their copyright notices.  You have
> the right to use their work, the GPL doesn't give you ownership of it.
> The usual way to do this is to leave their copyright notice intact, and
> add your own if you have made modifications.
>
> An alternative which is usually (but not always) better is to say that
> your package depends on theirs, and then just use their functions.  The
> advantage is that it avoids any of the above mixed copyright issues, and
> it makes sure that when the author fixes a bug, you benefit too.  The
> disadvantage is that it makes your package dependent on theirs, so if
> changes are needed in it for some future version of R, you'll have to
> wait for the other maintainer to do them (or copy their code at that point).
>
> (I'm a little sensitive about dependencies now, since the LaTeX seminar
> template I've used a few times no longer works.  It depends on too many
> LaTeX packages, and someone, somewhere has introduced incompatibilities
> in them.  Seems like I'll be forced to use Powerpoint or Impress.)
>
> Duncan Murdoch
>
>>
>> What about regarding code that was sent to the list, usually as a response
>> to one of my problems. I assume that in this case it is best to consult
>> the
>> author?
>
>> Any comments and opinions are very welcomed!
>>
>> Best regards,
>> Ales Ziberna
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide!
>> http://www.R-project.org/posting-guide.html
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Brian D. Ripley,                  [hidden email]
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

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

LaTeX slide show (Was: Re: Taking code from packages)

Henrik Bengtsson-2
In reply to this post by Duncan Murdoch
Duncan Murdoch wrote:
> On 1/13/2006 2:04 AM, Ales Ziberna wrote:
>
>>Hello!
>>
[snip]

> (I'm a little sensitive about dependencies now, since the LaTeX seminar
> template I've used a few times no longer works.  It depends on too many
> LaTeX packages, and someone, somewhere has introduced incompatibilities
> in them.  Seems like I'll be forced to use Powerpoint or Impress.)

Try LaTeX Beamer!  It is the best thing that happend to LaTeX in a long
time.  Simply beautiful, intuitive and very easy to use, and it's not
yet another 'seminar' or 'prosper'.   Part of MikTeX now.  See
http://latex-beamer.sourceforge.net/ for documentation, examples etc.

Cheers

Henrik

> Duncan Murdoch
>

[snip]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX slide show (Was: Re: Taking code from packages)

Duncan Murdoch
On 1/14/2006 2:39 AM, Henrik Bengtsson wrote:

> Duncan Murdoch wrote:
>> On 1/13/2006 2:04 AM, Ales Ziberna wrote:
>>
>>> Hello!
>>>
> [snip]
>
>> (I'm a little sensitive about dependencies now, since the LaTeX seminar
>> template I've used a few times no longer works.  It depends on too many
>> LaTeX packages, and someone, somewhere has introduced incompatibilities
>> in them.  Seems like I'll be forced to use Powerpoint or Impress.)
>
> Try LaTeX Beamer!  It is the best thing that happend to LaTeX in a long
> time.  Simply beautiful, intuitive and very easy to use, and it's not
> yet another 'seminar' or 'prosper'.   Part of MikTeX now.  See
> http://latex-beamer.sourceforge.net/ for documentation, examples etc.

Thanks to Henrik and Stephen Eglen for this suggestion.  It does look
nice (though the test presentation, beamerexample1.tex failed with

! Undefined control sequence.
<recently read> \rowcolors

l.937 \end{frame}

indicating some version incompatibility with what I've got installed,
the simpler examples all seem to work and do indeed give nice output.)

Duncan Murdoch

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX slide show (Was: Re: Taking code from packages)

Janusz Kawczak
Duncan,

it seems that you did not update 'xcolor' package properly. That's where
\rowcolors is defined. In some instances, especially under MikTeX, the
automatic update fails to update xcolor.sty. So, I suggest you download
the latest xcolor package from the same place as the beamer package and
then manually run 'latex xcolor.ins' to regenerate xcolor.sty. Then move
the *.def and *.sty file to the proper places to gain full compatibility.

Janusz.

** Janusz Kawczak **
** UNC at Charlotte, Department of Mathematics & Statistics, Room 345B **
** 9201 University City Blvd           **
** Charlotte, NC, 28223-0001, U.S.A. **
** Tel.: (W) (704) 687-2566  Fax.: (704) 687-6415 **

"All truth passes through three stages. First, it is ridiculed, second it
is violently opposed, and third, it is accepted as self-evident."
-- Arthur Schopenhauer

On Sat, 14 Jan 2006, Duncan Murdoch wrote:

> On 1/14/2006 2:39 AM, Henrik Bengtsson wrote:
> > Duncan Murdoch wrote:
> >> On 1/13/2006 2:04 AM, Ales Ziberna wrote:
> >>
> >>> Hello!
> >>>
> > [snip]
> >
> >> (I'm a little sensitive about dependencies now, since the LaTeX seminar
> >> template I've used a few times no longer works.  It depends on too many
> >> LaTeX packages, and someone, somewhere has introduced incompatibilities
> >> in them.  Seems like I'll be forced to use Powerpoint or Impress.)
> >
> > Try LaTeX Beamer!  It is the best thing that happend to LaTeX in a long
> > time.  Simply beautiful, intuitive and very easy to use, and it's not
> > yet another 'seminar' or 'prosper'.   Part of MikTeX now.  See
> > http://latex-beamer.sourceforge.net/ for documentation, examples etc.
>
> Thanks to Henrik and Stephen Eglen for this suggestion.  It does look
> nice (though the test presentation, beamerexample1.tex failed with
>
> ! Undefined control sequence.
> <recently read> \rowcolors
>
> l.937 \end{frame}
>
> indicating some version incompatibility with what I've got installed,
> the simpler examples all seem to work and do indeed give nice output.)
>
> Duncan Murdoch
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX slide show (Was: Re: Taking code from packages)

cberry
In reply to this post by Duncan Murdoch

I have a few notes on using beamer with Sweave here:

  https://biostat.ucsd.edu/~cberry/beamer/

Particularly, getting verbatim material to display nicely took a bit of
fiddling.

On Sat, 14 Jan 2006, Duncan Murdoch wrote:

> On 1/14/2006 2:39 AM, Henrik Bengtsson wrote:
>>  Duncan Murdoch wrote:
>> >  On 1/13/2006 2:04 AM, Ales Ziberna wrote:
>> >
>> > >  Hello!
>> > >
>>  [snip]
>>
>> >  (I'm a little sensitive about dependencies now, since the LaTeX seminar
>> >  template I've used a few times no longer works.  It depends on too many
>> >  LaTeX packages, and someone, somewhere has introduced incompatibilities
>> >  in them.  Seems like I'll be forced to use Powerpoint or Impress.)
>>
>>  Try LaTeX Beamer!  It is the best thing that happend to LaTeX in a long
>>  time.  Simply beautiful, intuitive and very easy to use, and it's not yet
>>  another 'seminar' or 'prosper'.   Part of MikTeX now.  See
>>  http://latex-beamer.sourceforge.net/ for documentation, examples etc.
>
> Thanks to Henrik and Stephen Eglen for this suggestion.  It does look nice
> (though the test presentation, beamerexample1.tex failed with
>
> ! Undefined control sequence.
> <recently read> \rowcolors
>
> l.937 \end{frame}
>
> indicating some version incompatibility with what I've got installed, the
> simpler examples all seem to work and do indeed give nice output.)
>
> Duncan Murdoch
>
>
>
>

Charles C. Berry                        (858) 534-2098
                                          Dept of Family/Preventive Medicine
E mailto:[hidden email]         UC San Diego
http://biostat.ucsd.edu/~cberry/         La Jolla, San Diego 92093-0717

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html