jpmml / r2pmml

R library for converting R models to PMML
GNU Affero General Public License v3.0
73 stars 18 forks source link

How to install r2pmml from zip file? #14

Closed sjain777 closed 7 years ago

sjain777 commented 7 years ago

Hi, I need to install all packages from command line via exe/zip files existing on my machine. I see r2pmml-master.zip is available for download. But doing the following does not install it:

Rscript.exe -e "install.packages('r2pmml-master.zip', repos = NULL)"

Can you please let me know the fix? Thanks, Supriya

vruusmann commented 7 years ago

This r2pmml-master.zip ZIP file is automatically created by GitHub.

Looks like it's simply the zipped contents of the latest commit. Install it exactly the same as you would install any other R package from its ZIP source distributable:

unzip -q r2pmml-master.zip
cd r2pmml-master/
R CMD INSTALL .

Please note that there's a dot character (.) at the end of the R CMD INSTALL . command!

sjain777 commented 7 years ago

Hi, thanks for your prompt reply. I tried the above. But the library gets installed as r2pmml-master inside of R\R3.3.3\library. Upon invoking it inside of an R session as follows: library("r2pmml-master") I get error that no such library exists. Is this due to the name of the zip file being r2pmml-master instead of r2pmml? Just by changing the name of the zip file did not work either. Your help in resolving this would be greatly appreciated! Thanks.

vruusmann commented 7 years ago

Did you enter the r2pmml-master directory BEFORE executing the R CMD INSTALL . command?

The name of the installed package is retrieved from the /DESCRIPTION file. So, it doesn't matter what your working directory is called, the r2pmml package will be always installed as "r2pmml".

As pointed out earlier, this is a standard procedure for installing R packages from (ZIP-) source distributables. If you need any help, just search the web using pharses such as "how to install R package from (ZIP-) source".

sjain777 commented 7 years ago

Thanks for explaining why one needed to cd to r2pmml-master. The problem was after unzipping, the source code and DESCRIPTION files landed in r2pmml-master\r2pmml-master. So I had to do: cd r2pmml-master\r2pmml-master for the installation command to work. Thanks much for your help in having this problem resolved!

vruusmann commented 7 years ago

The source code and DESCRIPTION files landed in r2pmml-master\r2pmml-master

To summarize, we are using different un-zip tools on different operating systems. I'm using command-line zip utility on GNU/Linux. When unzipping the r2pmml-master.zip file, it creates a shallow directory structure (the package information file is located at r2pmml-master/DESCRIPTION).

You're using some other un-zip tool, which creates an extra directory layer that corresponds to the name of the ZIP file (the package information file is located at <zip-file-name>/r2pmml-master/DESCRIPTION).