A drop-in replacement for the targets targets::tar_target() pattern helper head(), for use unquoted in the pattern argument of a tarpolyglot constructor. Like tarpolyglot_map(), on tar_target_rs() it compiles the extendr crate once in a companion <name>_rust_lib target and reuses it across the kept branches; on tar_target_py() / tar_target_jl() it is exactly head(). See tarpolyglot_map() for the full explanation and the compile-once mechanics.
Value
This function is a marker consumed by the tarpolyglot constructors and is not meant to be evaluated on its own; calling it directly raises an error.
Examples
if (FALSE) { # \dontrun{
tarpolyglot::tar_target_rs(
name = rs_first, script = "square.rs", inputs = c(x = "vals"),
post_script = "post.R", pattern = tarpolyglot_head(vals, n = 2)
)
} # }