% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/safe_data.R
\name{safe_data}
\alias{safe_data}
\alias{safe_data.character}
\alias{safe_data.opal}
\alias{safe_data.rocrate}
\title{Safe Data 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_data(x, ...)

\method{safe_data}{character}(
  x,
  ...,
  profile = attr(x, "profile"),
  project = attr(x, "project"),
  resources = attr(x, "resources"),
  tables = attr(x, "tables"),
  asset_id_suffix = "#asset:",
  project_id_suffix = "#project:",
  connection = attr(x, "connection"),
  path = attr(x, "path"),
  user = attr(x, "user")
)

\method{safe_data}{opal}(
  x,
  ...,
  rocrate = rocrateR::rocrate_5s(),
  profile = "default",
  project = NULL,
  resources = NULL,
  tables = NULL,
  include = c("tables", "resources"),
  asset_id_suffix = "#asset:",
  project_id_suffix = "#project:",
  path = NULL,
  user = NULL
)

\method{safe_data}{rocrate}(
  x,
  ...,
  profile = attr(x, "profile"),
  project = attr(x, "project"),
  resources = attr(x, "resources"),
  tables = attr(x, "tables"),
  asset_id_suffix = "#asset:",
  project_id_suffix = "#project:",
  connection = attr(x, "connection"),
  path = attr(x, "path"),
  user = attr(x, "user")
)
}
\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_data]{?dsROCrate::safe_data}}.}

\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{asset_id_suffix}{String with ID suffix for the tables/datasets
entities in the RO-Crate (default: \code{"#asset:"}).}

\item{project_id_suffix}{String with ID suffix for the project entities
in the RO-Crate (default: \code{"#project:"}).}

\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{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{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()}).}

\item{include}{Vector of strings with types of assets to be included, either
\code{"resources"}, \code{"tables"} or both.}
}
\value{
Updated RO-Crate object with Safe Data information.
}
\description{
Safe Data details for the RO-Crate.
}
\details{
Researchers only use de-identified data that is relevant to their study.

In compliance with the Digital Economy Act, data is effectively anonymised
within TREs (Trusted Research Environments).

This means any sensitive information that might lead to an individual being
identified, such as names and addresses, is either removed or replaced with
a random code. Researchers are not processing personal data when using data
prepared in this way and when the other Safes are in place. Find out more
about de-identification:
\url{https://www.researchdata.scot/engage-and-learn/data-explainers/what-is-data-de-identification/}
}
