## Not run:
# #The file I want to edit is called "Soil.xml" which is the the directory "~/APSIM"
# simFile <- "Soil.xml"
# apsimWd <- "~/APSIM"
#
# #I want to change the potential nitrification and N2O from nitrification
# simVar <- c("nitrification_pot", "dnit_nitrf_loss","wfnit_values")
#
# #Change both to absolute values of random N(0,1)
# simValue <- list(abs(rnorm(1)), abs(rnorm(1)), c(0,2,2,1))
#
# #Edit Soil.xml without overwriting it
# edit_sim_file(file = simFile, wd = apsimWd, var = simVar, value = simValue, overwrite = FALSE)
#
# #Passing an .apsim file to edit_sim_file will give a warning and redirect it to edit_apsim
# apsimFile <- "Canopy.apsim"
# apsimValue <- list(c(rep(200, 2), rep(300, 9)), 9, "NSW")
# apsimVar <- c("SoilWater/Thickness", "SoilOrganicMatter/SoilCN", "State")
# edit_sim_file(file = apsimFile, wd = apsimWd, var = apsimVar, value = apsimValue, overwrite = FALSE)
# ## End(Not run)
Run the code above in your browser using DataLab