plot_run_vars: Plot the desired variables from the results of a PEcAn run

View source: R/plot_run_vars.R

plot_run_varsR Documentation

Plot the desired variables from the results of a PEcAn run

Description

Plot the desired variables from the results of a PEcAn run. Hits the ⁠/api/run/{run_id}/graph/{year}/{y_var}⁠ API endpoint

Usage

plot_run_vars(
  server,
  run_id,
  year,
  y_var,
  x_var = "time",
  width = 800,
  height = 600,
  filename = "plot.png"
)

Arguments

server

Server object obtained using the connect() function

run_id

ID of the PEcAn run whose details are needed

year

the year this data is for

width

the width of the image generated, default is 800 pixels.

height

the height of the image generated, default is 600 pixels.

filename

File name to save the generated plot, default is 'plot.png'.

yvar

the variable to plot along the y-axis.

xvar

the variable to plot along the x-axis, by default time is used.

Value

Response obtained from the ⁠/api/run/{run_id}/graph/{year}/{y_var}⁠ endpoint

Author(s)

Tezan Sahu

Examples

server <- connect(url="http://pecan.localhost:80", username="carya", password="illinois")

# Plot the Gross Primary Productivity vs Time for the run with ID '99000000282' for the year 2002
plot_run_vars(server, run_id=99000000282, year=2002, y_var="GPP")

# Plot the Total Respiration vs Soil Respiration for the run with ID '99000000283' for the year 2002 of custom size
plot_run_vars(server, run_id=99000000283, year=2002, y_var="TotalResp", x_var="SoilResp", width=500, height=400)

PecanProject/rpecanapi documentation built on April 2, 2024, 8:17 a.m.