% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/safe_output.R
\name{safe_output}
\alias{safe_output}
\alias{safe_output.character}
\alias{safe_output.opal}
\alias{safe_output.rocrate}
\title{Safe Output details}
\source{
\itemize{
\item Research Data Scotland, 2025. "What is the Five Safes framework?".
\url{https://www.researchdata.scot/engage-and-learn/data-explainers/what-is-the-five-safes-framework/}
}
}
\usage{
safe_output(x, ...)

\method{safe_output}{character}(
  x,
  ...,
  path = attr(x, "path"),
  user = attr(x, "user"),
  logs_to = Sys.time(),
  logs_from = logs_to - 24 * 60^2,
  connection = attr(x, "connection"),
  profile = attr(x, "profile"),
  project = attr(x, "project"),
  resources = attr(x, "resources"),
  tables = attr(x, "tables")
)

\method{safe_output}{opal}(
  x,
  ...,
  rocrate = rocrateR::rocrate_5s(),
  path = NULL,
  user = NULL,
  logs_to = Sys.time(),
  logs_from = logs_to - 24 * 60^2,
  profile = "default",
  project = NULL,
  resources = NULL,
  tables = NULL
)

\method{safe_output}{rocrate}(
  x,
  ...,
  path = attr(x, "path"),
  user = attr(x, "user"),
  logs_to = Sys.time(),
  logs_from = logs_to - 24 * 60^2,
  connection = attr(x, "connection"),
  profile = attr(x, "profile"),
  project = attr(x, "project"),
  resources = attr(x, "resources"),
  tables = attr(x, "tables")
)
}
\arguments{
\item{x}{This can be a connection to a 'DataSHIELD' server (e.g., object with
the \code{opal} class, see \code{\link[opalr:opal.login]{opalr::opal.login()}}), an RO-Crate
(\link[rocrateR:rocrate]{rocrate} class) or a string with the path to an
RO-Crate.}

\item{...}{Other optional arguments. See the full documentation,
\code{\link[=safe_output]{?dsROCrate::safe_output}}.}

\item{path}{String with path pointing to the root of the RO-Crate. This will
be used to store log files. If not provided, logs will be stored within
the RO-Crate returned by this function.}

\item{user}{List (or \link[rocrateR:entity]{entity} object) with details for
the Safe People, it must include \verb{@id} and \code{name} entries. Alternatively,
this can be a string with the \code{name} of the current user.}

\item{logs_to}{Upper limit timestamp to filter out the outputs generated
(default: \code{Sys.time()}, current system time).}

\item{logs_from}{Lower limit timestamp to filter out the outputs generated
(default: \code{Sys.time() - 24 * 60 ^ 2}, last 24 hours).}

\item{connection}{Connection object for the 'DataSHIELD' server where the
values will be extracted from (e.g., OBiBa's Opal). Optional, if \code{x} is
set to a connection object. If so, then \code{rocrate} is required.}

\item{profile}{String with profile name (used for OBiBa's Opal backend).}

\item{project}{String with the name of the \link[=safe_project]{Safe Project}.}

\item{resources}{Vector of strings with the names of the resources, part of
\code{project}. Optional, if not provided, all the resources associated to
\code{project} will be included in the RO-Crate.}

\item{tables}{Vector of strings with the names of the tables/datasets, part
of \code{project}. Optional, if not provided, all the tables/datasets
associated to \code{project} will be included in the RO-Crate.}

\item{rocrate}{RO-Crate object. Optional, if \code{x} is either an RO-Crate
object or a path to a valid RO-Crate. If so, then \code{connection} is
required (default: \code{rocrateR::rocrate_5s()}).}
}
\value{
Updated RO-Crate object with Safe Outputs information.
}
\description{
Safe Output details for the RO-Crate.
}
\details{
All research outputs are checked to ensure individuals cannot be identified
even in the public domain.

This means the other four Safes no longer apply.

Before outputs are released from the TRE, they are checked to make sure it
is reasonably unlikely that any individuals can be identified on publication.
Compliance with the Digital Economy Act also requires that the TRE applies
methods and standards for output checking that are accredited by the UK
Statistics Authority.
}
