Description Usage Arguments Details Examples
Plot routine for "apsim"
class objects
1 2 |
x |
data frame of class |
y |
variable to plot on y-axis; if left empty all variables will be plotted on separate plots |
ask |
logical; if |
one_plot |
logical; if |
... |
additional arguments passed to |
Similar to the plot
for lm
objects, plot.apsim
will
plot each response in the results of an APSIM simulation on its own ggplot2
object. If the
one_plot
argument is set to TRUE
then facet_wrap
is used to plot
all of the responses on one screen. Alternatively, one response can be plotted by setting y
to
one variable corresponding to a column in x
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
apsimExe <-"C:/Program Files (x86)/Apsim75-r3008/Model/Apsim.exe"
apsimWd <- "~/APSIM"
toRun <- c("Centro.apsim", "Continuous Wheat.apsim")
results <- apsim(exe = apsimExe, wd = apsimWd, files = toRun)
#Look at all of the results as a function of time in seperate plots
plot(results[[2]])
#Put all variables on one faceted plot
plot(results[[2]], one_plot = TRUE) + theme_bw()
#Plot just yield as a function of time
plot(results[[2]], y = 'yield') + geom_line(colour = 'red') + theme_bw()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.