It makes a plot by sampling (e.g. monthly) the variables x and y

plot_sample(
  x,
  y = normalizeGaussian_severalstations(x = as.data.frame(x), data = as.data.frame(data),
    origin_x = origin_x, origin_data = origin_data, sample = sample, step = step, prec =
    prec)[, 1],
  xlim = range(x, na.rm = TRUE),
  legend_position = "topleft",
  ylim = range(y, na.rm = TRUE),
  pch = 1,
  col = 1,
  col_max = 0.9,
  col_min = 0.1,
  origin,
  sample = NULL,
  xhist = hist(x, breaks = breaks, plot = FALSE),
  yhist = hist(y, breaks = breaks, plot = FALSE),
  axes = FALSE,
  step = NULL,
  prec = 1e-04,
  breaks = 50,
  origin_x = origin,
  origin_data = origin,
  data = x,
  xlab = "",
  ylab = "",
  color = FALSE,
  gray = TRUE,
  sort = FALSE,
  valmin_x = valmin,
  valmin_y = valmin,
  valmin = -9999,
  abline = c(0, 1),
  ...
)

Arguments

x

vector of input data

y

vector of second input data. Default is normalizeGaussian_severalstations(x=as.data.frame(x),data=as.data.frame(data),origin_x=origin_x,origin_data=origin_data,sample=sample,step=step,prec=prec)[,1]

xlim, ylim, xlab, ylab

see plot.default (Graphic)

legend_position

legend position. Default is "topleft". See legend.

pch

integer single or multi values for pch (see plot.default). Default is 1.

col

integer single or multi values for col (see plot.default). Default is 1.

col_max

maximum value for color scale to apply to rainbow or rainbow. Utilized if col is not a vector and both gray or color are TRUE. Default is 0.9 .

col_min

minimum value for color scale to apply to rainbow or rainbow. Utilized if col is not a vector and both gray or color are TRUE. Default is 0.1 .

origin

date of the first row of x. See normalizeGaussian_severalstations.

sample

string character containg informatio how to sample x and y. Default is NULL. If NULL no sampling is done.see normalizeGaussian_severalstations. Only NULL or "monthly" options are implemented.

xhist

frequency histogram for x. Default is hist(x,breaks=breaks,plot=FALSE). If it is NULL, no marginal histograms appear.

yhist

frequency histogram for y. Default is hist(y,breaks=breaks,plot=FALSE). If it is NULL, no marginal histograms appear. =hist(y,breaks=breaks,plot=FALSE),

axes

see barplot

step, prec

see normalizeGaussian_severalstations

breaks

see hist

origin_x

see normalizeGaussian_severalstations. Default value is set equal to origin.

origin_data

normalizeGaussian_severalstations. Default value is set equal to origin.

data

normalizeGaussian_severalstations. Default value is set equal to x.

color

logical value. If TRUE and if col is unspecified, a color scale is applied according to col_min and col_max (see rainbow). Default is FALSE.

gray

logical value. If TRUE and if col is unspecified, a color scale is applied according to col_min and col_max (see gray). Default is TRUE.

sort

logical value. If TRUE, x and y are sorted and a Q-Q plot is presented. Deafault is FALSE.

valmin_x

numerical threshold value over which the variable x is plotted. It is enabled only if sort is set TRUE.

valmin_y

numerical threshold value over which the variable y is plotted. It is enabled only if sort is set TRUE.

valmin

numerical threshold value for valmin_y and valmin_x if there are not specified.

abline

arguments for abline function. Default is c(0,1). If it is NULL, abline is disabled and not called.

...

see graphical parametes on plot.default

@usage plot_sample(x, y = normalizeGaussian_severalstations(x = as.data.frame(x), data = as.data.frame(data), origin_x = origin_x, origin_data = origin_data, sample = sample, step = step, prec = prec)[, 1], xlim = range(x, na.rm = TRUE), legend_position = "topleft", ylim = range(y, na.rm = TRUE), pch = 1, col = 1, col_max = 0.9, col_min = 0.1, origin, sample = NULL, xhist = hist(x, breaks = breaks, plot = FALSE), yhist = hist(y, breaks = breaks, plot = FALSE), axes = FALSE, step = NULL, prec = 1e-04, breaks = 50, origin_x = origin, origin_data = origin, data = x, xlab = "", ylab = "", color = FALSE, gray = TRUE, sort = FALSE, valmin_x = valmin, valmin_y = valmin, valmin = -9999, abline = c(0, 1), ...)

Value

0 in case of success

Note

It makes a plot betwee x and y and shows thair respective probibilty histograms. If y is missing, it is automatically calculated as one-dimensional Gaussianization of x through the function normalizeGaussian_severalstations.

Examples

if (FALSE) { # \dontrun{

library(lubridate)
data(trentino)
plot_sample(x=TEMPERATURE_MIN$T0090,sample="monthly",
 origin="1958-1-1",axes=FALSE,xlab="Tn [ degC]",
 ylab="x")

set.seed(123456)
z <- rexp(10000,rate=0.5)
x <- normalizeGaussian(x=z,data=z)
plot_sample(x=z,xlab="z",ylab="x")
} # }