How to instal R package in linux


I have converted the file created in windows to a package_name.tar.gz file using an on line converter. I am following the following steps to build and install the package: R CMD build brocolors

(Replace brocolors with the name of your package directory, which hopefully is also the name of your package.)

You’ll see something like this

$ R CMD build package_name * checking for file 'package_name/DESCRIPTION' ... OK * preparing 'brocolors': * checking DESCRIPTION meta-information ... OK * checking for LF line-endings in source and make files * checking for empty or unneeded directories * creating default NAMESPACE file * building 'brocolors_0.1.tar.gz'

R CMD INSTALL package_name_1.2.tar.gz

This is exactly what I do (glyCount is the name of the directory where the .tar.gz file is.

R CMD build glyCount * checking for file ‘glyCount/DESCRIPTION’ ... OK * preparing ‘glyCount’: * checking DESCRIPTION meta-information ... OK Warning in file(con, "r") : cannot open file 'man': No such file or directory ERROR computing Rd index failed:cannot open the connection I do not understand why the building of the package is not working. Is it because the package has been created in windows?

There is not a file named man in the package directory. Is this file created only in linux when the package is created? Should the package have been created in linux as a .tar.gz file? I am thinking that may be I cannot convert from windows .zip to linux .tar.gz


Hi @giuseppa.cefalu,

In the RStudio IDE, you can use the Build Tab, and select Build Source Package to produce the tar.gz file.


Thank you for your example.