# Replace angles by sampling from an ellipsoidal distribution:
mydist <- angledist("ellipsoid", distpars=0.7)
replaceangles(pfile="someplant.p", distobj=mydist)
# Make constant angles:
replaceangles(pfile="someplant.p", newangles=45)
# Change new file name:
replaceangles(pfile="someplant.p", outputfile="someplant 45degrees.p", newangles=45)
# Change petiole orientation, choose pfile with dialog box:
replaceangles("Az.2", newangles=runif(300, 0, 360))
# Modify various variables in a pfile, until we end up with an artificial plant,
# useful for testing.
# Order of changes, in this case (although it does not matter!):
# Leaf azimuth, leaf orientation, leaf angle, petiole length, petiole angle.
modifypfile("originalplant.p", whichvar="Az.3", outputfile="testplant.p", newvalues=45)
modifypfile("testplant.p", whichvar="Or", outputfile="testplant.p", newvalues=45)
modifypfile("testplant.p", whichvar="An.3", outputfile="testplant.p", newvalues=-45)
modifypfile("testplant.p", whichvar="L.2", outputfile="testplant.p", newvalues=10)
modifypfile("testplant.p", whichvar="An.2", outputfile="testplant.p", newvalues=45)Run the code above in your browser using DataLab