Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

modify the source for R packages

Tags:

r

bioconductor

I want to remove one line:

if( nrow(mm) <= ncol(mm) )

from a bioconductor package "DEXSeq" How to do that?

like image 386
user1586241 Avatar asked Apr 27 '26 14:04

user1586241


1 Answers

An R package is just an archive containing several directories and files. You are free to modify them at will. Download the package -- it will have an ending of the form ".tar.gz". Unpack it; in many systems, the following (from command line) will work:

tar xzf package.tar.gz

or, if you have the zip Windows version of the package (package.zip), simply unzip it.

Enter the directory that was created, enter the directory "R" and locate the file that contains your function:

cd package
cd R
grep "if( nrow(mm) <= ncol(mm) )" *.R

edit it, and repack the package again:

cd ../..
tar czf package_mine.tar.gz

or, in Windows, zip the directory back to the package.zip form.

You can install and use package_mine now.

This is not the only way to do it, and canonically one should rebuild the package using R. However, for small modifications and quickly tryin out things it will do.

like image 117
January Avatar answered Apr 29 '26 04:04

January