Last data update: 2014.03.03

R: It makes a plot by sampling (e.g. monthly) the variables 'x'...
plot_sampleR Documentation

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

Description

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

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), ...)

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

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.

See Also

plot.default,extractmonths, see normalizeGaussian_severalstations

Examples

library(RMAWGEN)
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")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(RMAWGEN)
Loading required package: chron
Loading required package: date
Loading required package: vars
Loading required package: MASS
Loading required package: strucchange
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: sandwich
Loading required package: urca
Loading required package: lmtest
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RMAWGEN/plot_sample.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot_sample
> ### Title: It makes a plot by sampling (e.g. monthly) the variables 'x' and
> ###   'y'
> ### Aliases: plot_sample
> 
> ### ** Examples
> 
> library(RMAWGEN)
> 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")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>