Dear R users and experts, I need to modify an exisiting R function from a package. The function/ variable is inside a namespace and I have problems accessing it. I only need to get access to to corresponding sourcecode. I localised the "RDX" and "RDB" files. But it seems to be a binary format. How can I convert it to an ASCII format to open and extract the code from a text editio? Thanks Henri
Jean-Christophe BOUËTTÉ
2011-Sep-13 18:34 UTC
[R] Convert "RDX" and "RDB" to ASCII format?
Hi henri, R is open source, so you should be able to download the source code of the package from CRAN. JC 2011/9/13 Henri Mone <henriMone at gmail.com>:> Dear R users and experts, > > I need to modify an exisiting R function from a package. The function/ > variable is inside a namespace and I have problems accessing it. > I only need to get access to to corresponding sourcecode. I localised > the "RDX" and "RDB" files. But it seems to be a binary format. > How can I convert it to an ASCII format to open ?and extract the code > from a text editio? > > Thanks > Henri > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
On 13/09/2011 2:28 PM, Henri Mone wrote:> Dear R users and experts, > > I need to modify an exisiting R function from a package. The function/ > variable is inside a namespace and I have problems accessing it. > I only need to get access to to corresponding sourcecode. I localised > the "RDX" and "RDB" files. But it seems to be a binary format. > How can I convert it to an ASCII format to open and extract the code > from a text editio?If you are modifying a package, you should work on the source code, not the binary code. Use download.packages("foo", destdir="somewhere", type="source") to download a .tar.gz file containing the source. Then use "tar zxvf foo..." outside of R to extract the files. Alternatively, just load the package and print the function definitions to cut and paste into a file. But this will generally lose the comments and helpful formatting. Duncan Murdoch