SafeInsights Common Functions (
safeinsights_common.R
)

SafeInsights creates these methods for convenience of Data Partners to use in their research containers. They are not required to be used

toa_set_endpoint_and_creds()

Configure Trusted Output App credentials from environment variables.

Returns:

  • List with
    endpoint
    ,
    username
    , and
    password
    fields

Example:

source("safeinsights_common.R") # Get TOA configuration toa_config <- toa_set_endpoint_and_creds() print(paste("Endpoint:", toa_config$endpoint))

toa_job_start()

Notify the SafeInsights App via the Trusted Output App that analysis has started.

Example:

# Start your analysis workflow toa_job_start()

toa_results_upload(results_file)

Upload analysis results to the Trusted Output App for encryption.

Parameters:

  • results_file
    (string): Path to the file containing analysis results

Example:

# After completing analysis and saving results write.csv(my_results, "analysis_results.csv", row.names = FALSE) toa_results_upload("analysis_results.csv")