## Not run:
# # Replace an entire namelist
# replaceNameList(namelist="aerodyn",
# datfile="trees.dat", vals=list(zht=30,zpd=3,z0ht=0.6))
#
# #' # Replace a parameter with a single value:
# replacePAR("trees.dat", "notrees", "plot", newval=100)
#
# # Replace a number of values:
# replacePAR("trees.dat", "xycoords", "xy", newval=c(1,1,2,2,3,3))
#
# # Replace a number of values in a different way : this may be useful in
# # more complicated programs,
# # rr when reading a string from a file (that should be interpreted as a vector).
# replacePAR("trees.dat", "xycoords", "xy", newval="1 1 2 2 3 3", noquotes=TRUE)
#
# # Replace a parameter so that the new values are placed on multiple rows.
# # Useful for tree namelists with multiple dates and multiple trees
# # (where each row corresponds to a tree, and each column to a date.)
# m <- matrix(c(1,2,3,4,5,6,7,8,9), nrow=3, byrow=TRUE)
# replacePAR("trees.dat", "values", "indivlarea", newval=m)
# ## End(Not run)
Run the code above in your browser using DataLab