% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_subset_assignment.R
\name{[<-.HDF5Matrix}
\alias{[<-.HDF5Matrix}
\title{Subsetting assignment for HDF5Matrix objects}
\usage{
\method{[}{HDF5Matrix}(x, i, j, ...) <- value
}
\arguments{
\item{x}{An \code{HDF5Matrix} object}

\item{i}{Row indices (numeric, logical, or missing)}

\item{j}{Column indices (numeric, logical, or missing)}

\item{...}{Ignored}

\item{value}{Values to assign (scalar, vector, or matrix)}
}
\value{
The modified \code{HDF5Matrix} object (invisibly)
}
\description{
Subsetting assignment for HDF5Matrix objects
}
\details{
Writes data to the HDF5 dataset backing the \code{HDF5Matrix} object.
Supports:
\itemize{
\item Scalar assignment: \code{X[i, j] <- 5}
\item Vector assignment: \code{X[i, ] <- c(1, 2, 3)}
\item Matrix assignment: \code{X[1:3, 1:3] <- matrix(...)}
\item Full replacement: \code{X[] <- matrix(...)}
}

The value is automatically recycled or reshaped to match the target dimensions.
Changes are written immediately to disk.
}
\examples{
\donttest{

tmp <- tempfile(fileext = ".h5")

# Create a matrix
X  <- hdf5_create_matrix(tmp, "data/X", data = matrix(rnorm(100), 10, 10))

X <- hdf5_matrix(tmp, "data/X")

# Assign scalar
X[1, 1] <- 42

# Assign row
X[2, ] <- 1:10

# Assign block
X[1:3, 1:3] <- matrix(0, 3, 3)

hdf5_close_all()
unlink(tmp)
}

}
