% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wget_apsimx_json.R
\name{insert_replacement_node}
\alias{insert_replacement_node}
\title{Inserts a replacement node in a simple apsimx simulation file}
\usage{
insert_replacement_node(
  file,
  src.dir,
  wrt.dir,
  rep.node,
  edit.tag = "-edited",
  overwrite = FALSE,
  verbose = FALSE
)
}
\arguments{
\item{file}{file ending in .apsimx to be edited (JSON)}

\item{src.dir}{directory containing the .apsimx file to be edited; defaults to the current working directory}

\item{wrt.dir}{should be used if the destination directory is different from the src.dir}

\item{rep.node}{replacement node as obtained by the \code{\link{get_apsimx_json}} function}

\item{edit.tag}{if the file is edited a different tag from the default \sQuote{-edited} can be used.}

\item{overwrite}{logical; if \code{TRUE} the old file is overwritten, a new file is written otherwise}

\item{verbose}{whether to print information about successful edit}
}
\value{
it does not return an R object but it writes an apsimx file to disk
}
\description{
Inserts a replacement node in a simple apsimx simulation file
}
\examples{
\dontrun{
## It is not trivial to produce a reproducible example
## because the model and file versions need to align.
## The steps are:
## 1. Get model: 
##    wheat <- get_apsimx_json(model = "Wheat", wrt.dir = tmp.dir)
## 2. Create file that matches current model version
## 3. Edit the file by inserting the 'replacements' node
##    insert_replacement_node("Wheat.apsimx", rep.node = wheat)
                        
}

}
