Here we show how to call the R software for statistical computing from Geogebra using the Rserve R package. Rserve will make R to behave as a server so that it can be called from Geogebra. In this way, we expect to use many R functions not available in Geogebra.

If you have any comments about this link, you can contact us at virgilio.gomez@uclm.es.

More rencetly, we have developed another link using R package
opencpu. This
will work with current releases of Geogebra as it is based on a completely
different approach. Some examples have been developed in the GeogebraR package
and they can be found here:

http://becarioprecario.ocpu.io/GeogebraR/www/

Note that these examples will run on the browser and that no other software
(not even R!) needs to be installed.

**Installation**

After version 4.9.247, the Python Window was removed from Geogebra. For this reason, we provide links to the Geogebra 4.9.247 binaries below, with the latest version that includes the Python Window.

You will need to install the following software:

- R. It can be downloaded from http://cran.r-project.org/

- Geogebra-R files,
several files with examples and other R code to install extra packages. This
file contains:
- install_Rserve.R, is required to install Rserve and some extra R packages
used in the examples.
**Open R and copy and paste the contents of the file into the R console.**This will download some extra files (it may take a while) - Python files with examples (see below).

- install_Rserve.R, is required to install Rserve and some extra R packages
used in the examples.

The following files provide some small examples. The steps to run the examples are:

- Start R
- Start R serve, using one of the two methods shown below.
- Write the following commands in the R console:
library(Rserve) Rserve()

- Alternatively, you can run the R file provided with each example. These scripts will install Rserve and the R packages used in the examples if necessary.

- Write the following commands in the R console:
- Start Geogebra
- Open the Python Window in Geogebra
- Open any of the Python files provided below with the examples
- Run the Python script (see list of examples below).

We have created different examples:

- Simple test (RGeo-test.py)
This file provides a simple example to show the Geogebra-R connection by means of Rserve. In this example R is used to compute 1+1.

- Ramdom points (RGeo-rndpts.py)
In this example R is used to create 10 points at random that are later displayed in Geogebra.

- Quality Control Charts (RGeo-qcc.py)
In this example a quality control chart (QCC) is created from some random points. The points can be moved and the QCC is updated.

- Maps (RGeo-maps.py)
In this example a map of the counties of North Carolina (USA) is imported from R into Geogebra.

- Point patterns (RGeo-pp.py)
In this example the ratio on the intensities of two point patterns (cases and controles) is computed. This is often used in spatial epidemiology to detect areas of high incidence of a disease. The ratio is updated when a point is moved and it is diplayed using contour lines (but this feature is not working yet).

- Fit a smooth curve (RGeo-pp.py)
In this example a smooth curve (using LOWESS) is fit to a set of points. This reproduces an example provided in the R software from the lowess() manual page. When a point is moved the lowess cruve is recomputed.