% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/y_parameters.R
\name{parameters}
\alias{parameters}
\alias{list_parameters}
\alias{remove_parameters}
\alias{add_parameter}
\alias{move_parameter}
\alias{update_parameter}
\alias{select_parameter}
\title{Update parameters in your metadata}
\usage{
list_parameters(x)

remove_parameters(x, id)

add_parameter(
  x,
  id,
  label,
  columns,
  ...,
  .pos = length(x[["parameters"]]) + 1L
)

move_parameter(x, id, .pos = length(x[["parameters"]]))

update_parameter(x, id, ...)

select_parameter(x, id)
}
\arguments{
\item{x}{\code{mighty_domain()} Object to manipulate.}

\item{id}{\code{character()} Id of the parameter(s) to remove, add, or move.}

\item{label}{\code{character(1)} Parameter label.}

\item{columns}{\code{list()} Columns to set for the parameter.}

\item{...}{Additional properties to add for the parameter, e.g. a component reference.}

\item{.pos}{\code{integer(1)} Position to put or move the parameter to. Default places the parameter as the last.}
}
\value{
\code{invisible(x)}
}
\description{
Functions to list, select, remove, add, update, and move parameters in
your \code{mighty_domain()} objects.
}
\examples{
# Load example configuration
x <- mighty_domain(
  file = system.file("examples", "advs.yml", package = "mighty.metadata")
)

# List all parameters defined
list_parameters(x)

# Remove the BMIGRP parameter
x |>
  remove_parameters("BMIGRP") |>
  list_parameters()

# Add a new parameter
x |>
  add_parameter(
    id = "NEW",
    label = "My new parameter",
    columns = list(list(id = "AVAL"))
  ) |>
  list_parameters()

# Move the BMIGRP parameter to the 1st position
x |>
  move_parameter(id = "BMIGRP", .pos = 1) |>
  list_parameters()

# Update an existing parameter
x |>
  update_parameter(id = "BMI", label = "Updated BMI Label") |>
  select_parameter(id = "BMI") |>
  str()

# Select a specific parameter
select_parameter(x, id = "BMI") |>
  str()

}
