--- title: "Using Cluster.OBeu with OpenCPU" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Using Cluster.OBeu with OpenCPU} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- # Introduction This document describes the use of the functions implemented in *Cluster.OBeu* package in *OpenCPU* environment, after *[installing OpenCPU](https://www.opencpu.org/download.html)* and *Cluster.OBeu* package on your OpenCPU server address(/ocpu/test). # How to use functions - Go to: yourserver/ocpu/test - Type to the endpoint: ```{r, eval=FALSE, include=TRUE} ../library/ {name of the library} /R/ {function} ``` - If you want to see the function parameters you should: - Select Method: **`Get`** - To run a function you should: - Select Method: **`Post`** - Then you can click on **Ajax Request**. # OpenCPU and Cluster.OBeu ## cl.analysis In this example we will use `cl.analysis` function that returns in a single call a json string or a list with the following components: | Component | Description | | :------------: | :--------------------------------: | | cluster.method | Label of the clustering algorithm | | raw.data | Input data | | data.pca | Principal components | | modelparam | Clustering model specifications | | compare | Clustering measures | Table: *`cl.analysis`* components ## Select library and function 1. Go to: yourserver/ocpu/test 2. Copy and paste the following function to the endpoint ```{r, eval=FALSE, include=TRUE} ../library/Cluster.OBeu/R/cl.analysis # library/ {name of the library} /R/ {function} ``` 3. **Select Method**: **`Post`** ## Adding parameters parameters Click **add parameters** every time you want to add a new parameters and values. 4. Define the input data: - **Param Name**: **`cl.data`** - **Param Value**: e.g. **`sample_city_data`** 5. Define the *cluster algorithm* parameter: - **Param Name**: **`cl.meth`** - **Param Value**: **`pam`** 6. Define the *cluster number* parameter: - **Param Name**: **`clust.numb`** - **Param Value**: **`3`** For larger datasets you can specify likewise a specific clustering feature (*cl_feature*), the amounts and the aggregation if needed by defining *cl_feature*, *amount*, *cl.aggregate* parameters, see Cluster.OBeu *reference manual* for further details. 7. Ready! Click on **Ajax request**! ## Results 8. copy the **/ocpu/tmp/{this_id_number}/R/.val** (second on the right panel) 9. finally, paste **`yourserver/ocpu/tmp/{this_id_number}/R/.val`** on a new tab. # Further Details + [HTTP in OpenCPU](https://www.opencpu.org/api.html) + [OpenCPU Help](https://www.opencpu.org/help.html) + [OpenCPU JavaScript Client](https://www.opencpu.org/jslib.html) + [OpenCPU on CRAN](https://cran.r-project.org/package=opencpu) # Github + [OpenCPU package *development version*](https://github.com/opencpu/opencpu) + [Cluster.OBeu package *development version*](https://github.com/okgreece/Cluster.OBeu)