Title: | R Library for 'Harmony' |
---|---|
Description: | 'Harmony' is a tool using AI which allows you to compare items from questionnaires and identify similar content. You can try 'Harmony' at <https://harmonydata.ac.uk/app/> and you can read our blog at <https://harmonydata.ac.uk/blog/> or at <https://fastdatascience.com/how-does-harmony-work/>. Documentation at <https://harmonydata.ac.uk/harmony-r-released/>. |
Authors: | Omar Hassoun [aut, cre], Thomas Wood [ctb], Ulster University [cph] |
Maintainer: | Omar Hassoun <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.1 |
Built: | 2025-02-10 02:57:47 UTC |
Source: | https://github.com/cran/harmonydata |
This function retrieves example instruments from the 'Harmony Data API' using an HTTP POST request.
get_example_instruments()
get_example_instruments()
A list representing example instruments retrieved from the 'Harmony Data API'.
Ulster University [cph]
# Load required libraries (httr) and call the function require(httr) instruments <- get_example_instruments() # Print the retrieved JSON content print(instruments)
# Load required libraries (httr) and call the function require(httr) instruments <- get_example_instruments() # Print the retrieved JSON content print(instruments)
This function loads instruments from a file specified by the path
parameter and sends the file content to an API for further processing.
It also accepts a URL leading to a file.
load_instruments_from_file(path)
load_instruments_from_file(path)
path |
The path to the file to load instruments from. |
A list of instruments returned from the API.
Ulster University [cph]
# Load instruments from a PDF file pdf_file <- "https://www.apa.org/depression-guideline/patient-health-questionnaire.pdf" response <- load_instruments_from_file(pdf_file)
# Load instruments from a PDF file pdf_file <- "https://www.apa.org/depression-guideline/patient-health-questionnaire.pdf" response <- load_instruments_from_file(pdf_file)
This function takes a list of instruments, converts it to a format acceptable by the database, and matches the instruments using the 'Harmony Data API'. It returns the matched instruments.
match_instruments(instruments)
match_instruments(instruments)
instruments |
A list of instruments to be matched. |
A list of matched instruments returned from the 'Harmony Data API'.
Ulster University [cph]
For more information about the 'Harmony Data API', visit: https://api.harmonydata.org/docs
instruments_list <- list( list( instrument_id = "id1", instrument_name = "Instrument A", questions = list( list( question_text = "How old are you?", topics = c("Age", "Demographics"), source_page = "https://example.com/instrumentA" ), list( question_text = "What is your gender?", topics = c("Gender", "Demographics"), source_page = "https://example.com/instrumentA" ) ) ), list( instrument_id = "id2", instrument_name = "Instrument B", questions = list( list( question_text = "Do you smoke?", topics = c("Smoking", "Health"), source_page = "https://example.com/instrumentB" ) ) ) ) matched_instruments <- match_instruments(instruments_list)
instruments_list <- list( list( instrument_id = "id1", instrument_name = "Instrument A", questions = list( list( question_text = "How old are you?", topics = c("Age", "Demographics"), source_page = "https://example.com/instrumentA" ), list( question_text = "What is your gender?", topics = c("Gender", "Demographics"), source_page = "https://example.com/instrumentA" ) ) ), list( instrument_id = "id2", instrument_name = "Instrument B", questions = list( list( question_text = "Do you smoke?", topics = c("Smoking", "Health"), source_page = "https://example.com/instrumentB" ) ) ) ) matched_instruments <- match_instruments(instruments_list)