R bindings and utility functions for working with AmCAT
R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
howto
man
old
tests
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
NAMESPACE
README.md
amcat-r.Rproj

README.md

R bindings for the AmCAT API

This repository contains the package amcatr, which has a number of useful functions for working with the AmCAT API in R.

Installing

You can install amcatr directly from this github repository uising devtools:

if (!require(devtools)) {install.packages("devtools"); library(devtools)}
install_github("amcat/amcat-r")

Note: Every time you run the install_github command, the latest version of the package is automatically installed from github.

Connecting

Before you can connect to the API, you need to store the password in a file "~/.amcatauth". This can be done from R by calling amcat.save.password:

library(amcatr)
amcat.save.password("https://amcat.nl", username="example", password="secret")

Note: You only need to run this line once per computer, so do not save this line in a script, and certainly do not publish or email it, to avoid compromising the security of your account!

Now, you can connect to AmCAT using amcat.connect. This requests an authentication token from the specified AmCAT server and stores it for further commands. The resulting data (named conn, below) is then used every time you call the API.

library(amcatr)
conn = amcat.connect("https://amcat.nl")

Usage

All functions in amcatr start with amcat. and you can use the built-in help functions to view documentation.

To help you get started with the AmCAT API, please see the following how-to guides:

  • Howto: Querying deals with querying and metadata retrieval.
  • Howto: DTM shows how you can create a document term matrix, and refers to usefull packages for computational text analysis.