<commit_before># limer: A LimeSurvey R client

**limer** provides access to [LimeSurvey](https://www.limesurvey.org)'s [RemoteControl 2 API](https://manual.limesurvey.org/RemoteControl_2_API), allowing you to collect and analyze survey data in a simple, reproducible workflow.


## Installation

**limer** isn't on CRAN (yet), but it's easy to install directly from GitHub using [devtools](http://cran.r-project.org/web/packages/devtools/index.html):

```R
if(!require("devtools")) {
  install.packages("devtools")
  library("devtools")
}
install_github("andrewheiss/limer")
library("limer")
```


## Setup

Make sure you have enabled LimeSurvey's RPC interface, found in the administration section: Global settings > Interfaces > RPC interface enabled = JSON-RPC (*not* XML-RPC). You don't need to publish the API on `admin/remotecontrol`—all those details are [available elsewhere](http://api.limesurvey.org). The API URL should look something like http://example.com/limesurvey/admin/remotecontrol.

Load your API details and user credentials into R using `options()`:

```R
options(lime_api = 'http://example.com/limesurvey/admin/remotecontrol')
options(lime_username = 'put_username_here')
options(lime_user_id = 'put_user_id_here')
options(lime_password = '<PASSWORD>')
```

Before calling the API, you need to generate an access token. Many services provide tokens that last indefinitely, but by default LimeSurvey's will only last for two hours (though this can be modified by editing `limesurvey/application/config/config-default.php` and changing `$config['iSessionExpirationTime'] = 7200;`). Examples of how to do this are shown below.


## Code examples

To come…<commit_msg>Improve text<commit_after># limer: A LimeSurvey R client

**limer** provides access to [LimeSurvey](https://www.limesurvey.org)'s [RemoteControl 2 API](https://manual.limesurvey.org/RemoteControl_2_API), allowing you to collect and analyze survey data in a simple, reproducible workflow.


## Installation

**limer** isn't on CRAN (yet), but it's easy to install directly from GitHub using [devtools](http://cran.r-project.org/web/packages/devtools/index.html):

```R
if(!require("devtools")) {
  install.packages("devtools")
  library("devtools")
}
install_github("andrewheiss/limer")
library("limer")
```


## Setup

Make sure you have enabled LimeSurvey's RPC interface, found in the administration section: Global settings > Interfaces > RPC interface enabled = JSON-RPC (*not* XML-RPC). You don't need to publish the API on `admin/remotecontrol`—all those details are [available elsewhere](http://api.limesurvey.org). The API URL should look something like http://example.com/limesurvey/admin/remotecontrol.

Load your API details and user credentials into R using `options()`:

```R
options(lime_api = 'http://example.com/limesurvey/admin/remotecontrol')
options(lime_username = 'put_username_here')
options(lime_user_id = 'put_user_id_here')
options(lime_password = '<PASSWORD>')
```

Before calling the API, you need to generate an access token (examples of how to do this are shown below). Many services provide tokens that last indefinitely, but by default LimeSurvey's will only last for two hours (though this can be modified by editing `limesurvey/application/config/config-default.php` and changing `$config['iSessionExpirationTime'] = 7200;`). 


## Code examples

To come…
{'fraction_non_alphanumeric': 0.11703703703703704, 'fraction_numerical': 0.0035555555555555557, 'mean_word_length': 5.698412698412699, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6448858', 'n_tokens_mistral': 1038, 'n_tokens_neox': 982, 'n_words': 334}