Description Usage Arguments Value Functions Examples
This method allows you to make plots (using simple and expressive arguments) of the variables contained inside an hydroMet_XXX
object. The plot outputs can be static (ggplot2
) or interactive (plotly
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | plot_hydroMet(
obj,
slot_name,
col_number,
interactive = FALSE,
line_type = NULL,
line_color = "dodgerblue",
x_lab = "Date",
y_lab = "y",
title_lab = NULL,
legend_lab = NULL,
double_yaxis = NULL,
list_extra = NULL,
from = NULL,
to = NULL,
scatter = NULL
)
## S4 method for signature 'hydroMet_BDHI'
plot_hydroMet(
obj,
slot_name,
col_number,
interactive = FALSE,
line_type = NULL,
line_color = "dodgerblue",
x_lab = "Date",
y_lab = "y",
title_lab = NULL,
legend_lab = NULL,
double_yaxis = NULL,
list_extra = NULL,
from = NULL,
to = NULL
)
## S4 method for signature 'hydroMet_CR2'
plot_hydroMet(
obj,
slot_name,
col_number,
interactive = FALSE,
line_type = NULL,
line_color = "dodgerblue",
x_lab = "Date",
y_lab = "y",
title_lab = NULL,
legend_lab = NULL,
double_yaxis = NULL,
list_extra = NULL,
from = NULL,
to = NULL
)
## S4 method for signature 'hydroMet_DGI'
plot_hydroMet(
obj,
slot_name,
col_number,
interactive = FALSE,
line_type = NULL,
line_color = "dodgerblue",
x_lab = "Date",
y_lab = "y",
title_lab = NULL,
legend_lab = NULL,
double_yaxis = NULL,
list_extra = NULL,
from = NULL,
to = NULL
)
## S4 method for signature 'hydroMet_IANIGLA'
plot_hydroMet(
obj,
slot_name,
col_number,
interactive = FALSE,
line_type = NULL,
line_color = "dodgerblue",
x_lab = "Date",
y_lab = "y",
title_lab = NULL,
legend_lab = NULL,
double_yaxis = NULL,
list_extra = NULL,
from = NULL,
to = NULL
)
## S4 method for signature 'hydroMet_compact'
plot_hydroMet(
obj,
slot_name,
col_number,
interactive = FALSE,
line_type = NULL,
line_color = "dodgerblue",
x_lab = "x",
y_lab = "y",
title_lab = NULL,
legend_lab = NULL,
double_yaxis = NULL,
list_extra = NULL,
from = NULL,
to = NULL,
scatter = NULL
)
|
obj |
a valid |
slot_name |
string(s) with the name of the slot(s) to use in plotting. |
col_number |
numeric (vector) with the column's variable to plot. In case you decide to merge slots you must provide a list in which each element contains the column numbers of the variable to plot. |
interactive |
logical. Default value, |
line_type |
string with line dash type ( |
line_color |
string with a valid |
x_lab |
string with |
y_lab |
string with |
title_lab |
string with the title of the plot. Default is a plot without title. |
legend_lab |
string with plot label(s) name(s). NOTE: |
double_yaxis |
numeric vector with either |
list_extra |
list with the |
from |
string (or |
to |
string (or |
scatter |
numeric vector of length two with the column number to plot as scatter. The first variable (column number) will be the |
A ggplot2
or plotly
objects to analyze your data.
plot_hydroMet,hydroMet_BDHI-method
: plot method for BDHI class
plot_hydroMet,hydroMet_CR2-method
: plot method for CR2 class
plot_hydroMet,hydroMet_DGI-method
: plot method for DGI class
plot_hydroMet,hydroMet_IANIGLA-method
: plot method for IANIGLA class
plot_hydroMet,hydroMet_compact-method
: plot method for compact
class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Path to file
dgi_path <- system.file('extdata', package = "hydroToolkit")
file_name <- list.files(path = dgi_path, pattern = 'Toscas')
# Read Toscas
var_nom <- list(slotNames(x = 'hydroMet_DGI')[2:7])
names(var_nom) <- file_name
# Load Toscas meteo station data
toscas_dgi <- create_hydroMet(class_name = 'DGI')
toscas_dgi <- build_hydroMet(obj = toscas_dgi, slot_list = var_nom, path = dgi_path)
# Plot mean air temperature
plot_hydroMet(obj = toscas_dgi, col_number = 2, slot_name = 'tmean',
legend_lab = 'Tmean(ºC)' )
# Now let's plot an interactive graph
plot_hydroMet(obj = toscas_dgi, col_number = 2, slot_name = 'tmean',
interactive = TRUE, y_lab = 'Tmean(ºC)' )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.