gm.tsl: Time serie line Graphic Model

Description Usage Arguments Value Examples

View source: R/gmtsl.R

Description

gm.tsl make a line plot in time serie format. Graphic models function family make graphic creation easy, is recommended for new programers, they have less and easyful parameters then p.tsl but the graphic customize is more limited. The data don't need be a ts object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
gm.tsl(
  data,
  ncolx,
  ncoly,
  ntimes,
  title,
  ylab = NULL,
  percent = FALSE,
  div100 = FALSE,
  fontsize = 0,
  lwdserie = 1,
  datebreaks = "1 months",
  dateformat = "%b/%y",
  cserie = "white",
  clines = "white",
  ctext = "white",
  cbackground = "#141414"
)

Arguments

data

a dataframe

ncolx

number of x column in data frame

ncoly

number of y column in data frame

ntimes

number of observations to plot (count by tail)

title

title of plot

ylab

y axis label

percent

If TRUE y axis in percent (default=F)

div100

If data percent are not in decimal format set TRUE.

fontsize

change size of all words in graphic (only numbers)

lwdserie

size of serie

datebreaks

datebreaks in x axis (default="1 month")

dateformat

format of date in x axis (need a dataformat string) (default ="%Y-%m")

cserie

color of serie

clines

color of lines in graphic

ctext

color of words in graphic

cbackground

color of graphic background

Value

Return a graphic.

Examples

1
2
3
4
v=data.frame("x"=seq.Date(as.Date('2020-01-01'),
to = as.Date('2020-04-01'),by='month'),"y"=c(5,3,7,2))

gm.tsl(v,1,2,title="Simple example",ntimes=3)

jvg0mes/metools documentation built on June 28, 2020, 2:38 a.m.