On Wed, Apr 7, 2010 at 12:48 PM, zahra sheikhbahaee <sheikhbah...@gmail.com> wrote: > Hi > > how could I add a function from old version to new one and then call it in > my program as being accessible by it?
You would need to add the code to the R directory in the package source. Then, if the package has a NAMESPACE, you would need to add that function to the export. Finally, you would then reinstall the source package. The R manual for writing R extensions is relevant here. However, it might be most straightforward to contact the package author and explain the situation. It would be pretty unusual for an author to remove functionality from a package for no good reason. Perhaps the original function had a bug or has been replaced by a function with similar functionality. In any case, contacting the package author at this point seems warranted. Explain what you want to do, perhaps sending the code that you previously used, and see what he/she has to say about how to accomplish that task with the current code base. Sean > Zahra. > > On Wed, Apr 7, 2010 at 6:39 PM, Sean Davis <seand...@gmail.com> wrote: >> >> On Wed, Apr 7, 2010 at 12:26 PM, zahra sheikhbahaee >> <sheikhbah...@gmail.com> wrote: >> > Hi, >> > >> > I am using a package of R in my python code. I have to import two >> > versions >> > of package in my program, because there is a function in one of them >> > which >> > does not exist in the new version. The problem is that, afterward I want >> > to >> > use one of the functions of new version but it looks for the function in >> > old >> > version and ask the parameters of the other version which does not have >> > the >> > some abilities of the new funcion. I wonder how I could export from the >> > first package and import in the new one in one program. >> >> This is a limitation of R, I believe. I do not think you can import >> two versions of the same package in R simultaneously (but I could be >> wrong). I would suggest that you take the function from the older >> package and make a new package with that function that depends on the >> newer version of the original package. Also, make sure that the old >> function is truly NOT in the new version of the package, as sometimes >> it is there but not exported. A simple way to check in R is to do: >> >> packagename:::functionname >> >> Note the ::: operator. If none of this is quite right, have a look at >> the R function detach(), but note that detaching a package is not >> guaranteed to be successful. >> >> Sean >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> rpy-list mailing list >> rpy-list@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rpy-list > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > rpy-list mailing list > rpy-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rpy-list > > ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ rpy-list mailing list rpy-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpy-list