R SDK (Deprecated)
The R SDK for LAMP is deprecated and no longer actively maintained.
Alternatives​
- Python SDK — The recommended SDK for data analysis. Install with
pip install LAMP-core. R users can call Python from R using the reticulate package. - REST API — Use R's
httrpackage to make direct API calls.
Using the REST API from R​
library(httr)
library(jsonlite)
# Authenticate and query
response <- GET(
"https://api.lamp.digital/participant/<id>/sensor_event",
authenticate("email@address.com", "password"),
query = list(origin = "lamp.gps")
)
data <- fromJSON(content(response, "text"))
Using Python via reticulate​
library(reticulate)
LAMP <- import("LAMP")
LAMP$connect("email@address.com", "password", "api.lamp.digital")
events <- LAMP$SensorEvent$all_by_participant(participant_id, origin="lamp.gps")