Installation
============

Unix
----
Install `the rPython package <https://cran.r-project.org/package=rPython>`_, see 
file `INSTALL <https://cran.r-project.org/package=rPython/INSTALL>`_ there.

Then install excerptr from `CRAN <https://cran.r-project.org/package=excerptr>`_
.. code::
    install.packages("excerptr")

Windows
-------
Install `rPython-win <https://github.com/cjgb/rPython-win>`_
(follow the instructions at 
`https://cran.r-project.org/web/packages/rPython/INSTALL <https://cran.r-project.org/package=rPython/INSTALL>`_
).

Then get the excerptr source
from `github <https://github.com/fvafrCU/excerptr>`_, edit the file DESCRIPTION and remove the line reading
    OS_type: unix
and install the package manually:
.. code::
    if (! require("git2r")) install.packages("git2r")
    local_path <- dirname(tempdir())
    description <- file.path(local_path, "DESCRIPTION")
    git2r::clone("https://github.com/fvafrCU/excerptr", local_path = local_path)
    d <- readLines(description)
    d1 <- d[-grep("^OS_type:", d)]
    writeLines(d1, description)
    install.packages(local_path, repos = NULL, type = "source")

