nlsAddLines: nlsAddLines

View source: R/nlsAddLines.R

nlsAddLinesR Documentation

nlsAddLines

Description

Adds lines of specific countries into the plot of the function nlsregression. nlsregression has to be based on magpie objects for x,y,weight

Usage

nlsAddLines(
  y,
  x,
  countries = 1:5,
  weight = NULL,
  x_log10 = FALSE,
  colors = "black",
  labels = TRUE
)

Arguments

y

magpie object with y values

x

magpie object with x values

countries

Choice of countries

weight

magpie object with weight

x_log10

same as in nlsregression

colors

colors of the lines

labels

If TRUE, the region, staryear and endyear will be plotted to each line.

Value

vector with ISO-countrycodes

Author(s)

Benjamin Leon Bodirsky

See Also

nlsregression

Examples


## Not run:  
data(population_magpie)
nlsregression(y=population_magpie[,,1],x=population_magpie[,,2],
weight = population_magpie[,,1],func = y~a*x+b)
nlsAddLines(y=population_magpie[,,1],x=population_magpie[,,2],
weight = population_magpie[,,1],countries=1:3,colors=1:3)

## End(Not run)

pik-piam/regressionworlddata documentation built on June 6, 2024, 11:08 p.m.