Skip to content
Snippets Groups Projects
Commit 49465a93 authored by Fabian Stenzel's avatar Fabian Stenzel
Browse files

roxygenized, incremented version number and removed old sav_files

parent d9cf73a0
No related branches found
No related tags found
1 merge request!4full review
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCOL.R
% Please edit documentation in R/MCOL.R, R/MCOL_sav.R
\name{plotMCOLmap}
\alias{plotMCOLmap}
\title{Plot global map of MCOL to file}
\usage{
plotMCOLmap(data, file, title, legendtitle, zeroThreshold = 0.1, eps = FALSE)
plotMCOLmap(
data,
file,
title = "",
legendtitle = "",
zeroThreshold = 0.1,
eps = FALSE
)
plotMCOLmap(
data,
file,
title = "",
legendtitle = "",
zeroThreshold = 0.1,
eps = FALSE
)
}
\arguments{
\item{data}{array containing MCOL percentage value for each gridcell}
......@@ -23,12 +39,18 @@ both for negative and positive values (default: 0.1)}
\item{plotyears}{range of years to plot over time}
}
\value{
none
none
}
\description{
Plot global map of MCOL to file with legend colors similar to Haberl et al. 2007
Plot global map of MCOL to file with legend colors similar to Haberl et al. 2007
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCOL.R
% Please edit documentation in R/MCOL.R, R/MCOL_sav.R
\name{plotMCOLovertime}
\alias{plotMCOLovertime}
\title{Plot absolute MCOL, overtime, maps, and npp into given folder}
......@@ -13,21 +13,36 @@ plotMCOLovertime(
minVal = 0,
maxVal = 100,
legendpos = "topleft",
ext = FALSE,
eps = FALSE,
ref = "pi"
ref = "pi",
eps = FALSE
)
plotMCOLovertime(
mcolData,
file,
firstyr,
plotyrs,
highlightyrs = 2000,
minVal = 0,
maxVal = 100,
legendpos = "topleft",
ref = "pi",
eps = FALSE
)
}
\arguments{
\item{mcolData}{mcol data list object (returned from calcMCOL) containing
mcol, npp_eco_overtime, npp_act_overtime, npp_pot_overtime,
npp_bioenergy_overtime, mcol_overtime, npp_harv_overtime,
mcol_overtime_perc_piref, mcol_perc, mcol_perc_piref, ynpp}
mcol, npp_eco_overtime, npp_act_overtime, npp_pot_overtime,
npp_bioenergy_overtime, mcol_overtime, npp_harv_overtime,
mcol_overtime_perc_piref, mcol_perc, mcol_perc_piref, ynpp
all in GtC}
\item{file}{character string for location/file to save plot to}
\item{firstyr}{first year of mcol object}
\item{plotyrs}{range of years to plot over time}
\item{highlightyrs}{year(s) that should be highlighted in overtime plot (default: 2000)}
\item{minVal}{y-axis minimum value for plot over time (default: 0)}
......@@ -36,26 +51,26 @@ mcol_overtime_perc_piref, mcol_perc, mcol_perc_piref, ynpp}
\item{legendpos}{position of legend (default: "topleft")}
\item{eps}{write plots as eps, instead of png (default = FALSE)}
\item{ref}{reference period for mcol ("pi" or "act"), to either use
mcolData$mcol_overtime_perc_piref or mcolData$mcol_overtime}
\item{plotyears}{range of years to plot over time}
\item{mapyear}{year to plot mcol map for}
\item{mapyear_buffer}{+- years around mapyear to average mcol
(make sure these years exist in mcol data)}
\item{eps}{write plots as eps, instead of png (default = FALSE)}
}
\value{
none
none
}
\description{
Plot to file a comparison over time of global sums of MCOL, NPPpot, NPPeco,
and NPPact, with legend similar to Krausmann et al. 2013
Plot to file a comparison over time of global sums of MCOL, NPPpot, NPPeco,
and NPPact, with legend similar to Krausmann et al. 2013
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOcrossTable}
\alias{plotMECOcrossTable}
\title{Plot crosstable to file showing (dis-)similarity between average biome pixels}
\usage{
plotMECOcrossTable(data, file, lmar = 3, eps = FALSE)
plotMECOcrossTable(data, file, lmar = 3, eps = FALSE)
}
\arguments{
......@@ -16,14 +18,22 @@ plotMECOcrossTable(data, file, lmar = 3, eps = FALSE)
\item{eps}{write as eps or png}
}
\value{
None
None
}
\description{
Function to plot to file a crosstable showing (dis-)similarity between average
biome pixels based on M-ECO (former Gamma) metric from LPJmL simulations
Function to plot to file a crosstable showing (dis-)similarity between average
biome pixels based on M-ECO (former Gamma) metric from LPJmL simulations
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOcrossTableToScreen}
\alias{plotMECOcrossTableToScreen}
\title{Plot crosstable showing (dis-)similarity between average biome pixels}
\usage{
plotMECOcrossTableToScreen(data, lmar = 3)
plotMECOcrossTableToScreen(data, lmar = 3)
}
\arguments{
......@@ -12,14 +14,22 @@ plotMECOcrossTableToScreen(data, lmar = 3)
\item{lmar}{left margin for plot in lines (default: 3)}
}
\value{
None
None
}
\description{
Function to plot a crosstable showing (dis-)similarity between average
biome pixels based on M-ECO (former gamma) metric from LPJmL simulations
Function to plot a crosstable showing (dis-)similarity between average
biome pixels based on M-ECO (former gamma) metric from LPJmL simulations
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOmap}
\alias{plotMECOmap}
\title{Plot MECO map to file}
......@@ -10,7 +10,19 @@ plotMECOmap(
focusBiome = NULL,
biome_classes = NULL,
title = "",
legendtitle,
legendtitle = "",
eps = FALSE,
titleSize = 1,
legYes = T
)
plotMECOmap(
data,
file,
focusBiome = NULL,
biome_classes = NULL,
title = "",
legendtitle = "",
eps = FALSE,
titleSize = 1,
legYes = T
......@@ -36,13 +48,20 @@ plotMECOmap(
\item{legScale}{scaling factor for legend. defaults to 1}
}
\value{
None
None
}
\description{
Function to plot a global map of MECO values [0-1] per grid cell to file
Function to plot a global map of MECO values [0-1] per grid cell to file
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOmapToScreen}
\alias{plotMECOmapToScreen}
\title{Plot MECO map to screen}
......@@ -9,7 +9,17 @@ plotMECOmapToScreen(
focusBiome = NULL,
biome_classes = NULL,
title = "",
legendtitle,
legendtitle = "",
titleSize = 1,
legYes = T
)
plotMECOmapToScreen(
data,
focusBiome = NULL,
biome_classes = NULL,
title = "",
legendtitle = "",
titleSize = 1,
legYes = T
)
......@@ -30,13 +40,20 @@ plotMECOmapToScreen(
\item{legScale}{scaling factor for legend. defaults to 1}
}
\value{
None
None
}
\description{
Function to plot a global map of MECO values [0-1] per grid cell to screen
Function to plot a global map of MECO values [0-1] per grid cell to screen
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOovertimePanel}
\alias{plotMECOovertimePanel}
\title{Plot timeline of MECO variables as panel to file with 4/16 biomes}
\usage{
plotMECOovertimePanel(
data,
biomeNames,
file,
yrange = c(0, 1),
timerange,
eps = FALSE,
varnames = NULL
)
plotMECOovertimePanel(
data,
biomeNames,
file,
yrange = c(0, 1),
timerange,
eps = FALSE,
varnames = NULL
)
}
\arguments{
\item{data}{MECO data array c(4/19[biomes],[nMECOcomponents],3[min,mean,max])}
\item{biomeNames}{names of biomes}
\item{file}{to write into}
\item{yrange}{range for y axis (default c(0,1))}
\item{timerange}{of the data input}
\item{eps}{write as eps or png}
}
\value{
None
None
}
\description{
Function to plot a panel of 4/16 timelines per biome aggregated MECO values [0-1]
to file
Function to plot a panel of 4/16 timelines per biome aggregated MECO values [0-1]
to file
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOradial}
\alias{plotMECOradial}
\title{Plot radial MECO plot to file}
\usage{
plotMECOradial(data, file, title = "", legYes = T, eps = FALSE, quantile = T)
plotMECOradial(data, file, title = "", legYes = T, eps = FALSE, quantile = T)
}
\arguments{
......@@ -22,14 +24,22 @@ plotMECOradial(data, file, title = "", legYes = T, eps = FALSE, quantile = T)
for the regular MECO plot}
}
\value{
None
None
}
\description{
Function to plot an aggregated radial status of MECO values [0-1]
for the different sub-categories to file
Function to plot an aggregated radial status of MECO values [0-1]
for the different sub-categories to file
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOradialPanel}
\alias{plotMECOradialPanel}
\title{Plot radial MECO panel to file with 4/16 biomes}
\usage{
plotMECOradialPanel(data, biomeNames, file, quantile = T, eps = FALSE)
plotMECOradialPanel(data, biomeNames, file, quantile = T, eps = FALSE)
}
\arguments{
......@@ -18,14 +20,22 @@ plotMECOradialPanel(data, biomeNames, file, quantile = T, eps = FALSE)
\item{eps}{write as eps or png}
}
\value{
None
None
}
\description{
Function to plot an aggregated radial status of MECO values [0-1]
for the different sub-categories to file
Function to plot an aggregated radial status of MECO values [0-1]
for the different sub-categories to file
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotMECOradialToScreen}
\alias{plotMECOradialToScreen}
\title{Plot radial MECO plot to screen}
\usage{
plotMECOradialToScreen(
data,
title = "",
zoom = 1,
type = "regular",
titleSize = 2,
titleline = -2,
quantile = T
)
plotMECOradialToScreen(
data,
title = "",
......@@ -28,14 +38,22 @@ for the regular MECO plot}
\item{titleSize}{scaling factor for tile. defaults to 1}
}
\value{
None
None
}
\description{
Function to plot an aggregated radial status of MECO values [0-1]
for the different sub-categories to screen
Function to plot an aggregated radial status of MECO values [0-1]
for the different sub-categories to screen
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{plotOvertimeToScreen}
\alias{plotOvertimeToScreen}
\title{Plot timeline of MECO variables to screen}
\usage{
plotOvertimeToScreen(
data,
timerange,
yrange = c(0, 1),
legYes = T,
legOnly = F,
varnames = NULL
)
plotOvertimeToScreen(
data,
timerange,
yrange = c(0, 1),
legYes = T,
legOnly = F,
varnames = NULL
)
}
\arguments{
\item{data}{MECO data array
c(4/19[biomes],8/10[nMECOcomponents],3[min,mean,max],timeslices)}
\item{timerange}{of the data input}
\item{yrange}{range for y axis default c(0,1)}
\item{legYes}{plot legend (default T)}
}
\value{
None
None
}
\description{
Function to plot timeline of MECO variables to screen
Function to plot timeline of MECO variables to screen
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MCOL.R
% Please edit documentation in R/MCOL.R, R/MCOL_sav.R
\name{readMCOLdata}
\alias{readMCOLdata}
\title{Calculate the ecosystem change metric gamma between 2 simulations/timesteps}
\title{Calculate MCOL based on a PNV run and LU run of LPJmL}
\usage{
readMCOLdata(
inFol_lu,
inFol_pnv,
startyr,
stopyr,
gridbased = T,
pftbands = 11,
cftbands = 32,
headersize = 0,
saveDataFile = FALSE,
dataFile,
ncells = 67420,
fileType = "clm",
varnames
)
readMCOLdata(
inFol_lu,
inFol_pnv,
......@@ -49,15 +65,24 @@ readMCOLdata(
see code of calcMCOL() for an example with default values}
}
\value{
list data object containing arrays of ...
list data object containing the data to compute MCOL as arrays of
ynpp_potential, ynpp, pftnpp_cft, pftnpp_nat, pftnpp_grasslands,
pftnpp_bioenergy, harvest_cft, rharvest_cft, fire, timber, cftfrac,
fpc, harvest_grasslands, harvest_bioenergy
list data object containing the data to compute MCOL as arrays of
ynpp_potential, ynpp, pftnpp_cft, pftnpp_nat, pftnpp_grasslands,
pftnpp_bioenergy, harvest_cft, rharvest_cft, fire, timber, cftfrac,
fpc, harvest_grasslands, harvest_bioenergy
}
\description{
Function to calculate the ecosystem change metric gamma according
to Sykes (1999), Heyder (2011), and Ostberg (2015,2018).
This is a reformulated version in R, not producing 100% similar values
than the C/bash version from Ostberg 2018, but following their methodology.
Function to calculate MCOL based on a PNV run and LU run of LPJmL
Function to calculate MCOL based on a PNV run and LU run of LPJmL
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{readMECOData}
\alias{readMECOData}
\title{Read in output data from LPJmL to calculate the ecosystem change metric MECO}
\usage{
readMECOData(
folderRef,
folderRef2 = NULL,
folderScen,
saveFile = NULL,
export = FALSE,
combined = FALSE,
varnames,
headerout = 0,
timespan_full_ref,
timespan_full_scen,
timespan_focus_ref,
timespan_focus_ref2 = NULL,
timespan_focus_scen,
nitrogen,
npfts,
ncfts,
nbfts,
ncells,
soillayers = 6
)
readMECOData(
folderRef,
folderRef2 = NULL,
......@@ -66,14 +88,22 @@ readMECOData(
\item{soillayers}{number of soil layers (default = 6)}
}
\value{
list data object containing arrays of state_ref, mean_state_ref,
state_scen, mean_state_scen, fpc_ref, fpc_scen, bft_ref, bft_scen,
cft_ref, cft_scen, lat, lon, cellArea
list data object containing arrays of state_ref, mean_state_ref,
state_scen, mean_state_scen, fpc_ref, fpc_scen, bft_ref, bft_scen,
cft_ref, cft_scen, lat, lon, cellArea
}
\description{
Utility function to read in output data from LPJmL for calculation of MECO
Utility function to read in output data from LPJmL for calculation of MECO
}
\examples{
\dontrun{
}
\dontrun{
}
}
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/MECO.R
% Please edit documentation in R/MECO.R, R/MECO_sav.R
\name{replaceRefDataWithAverageRefBiomeCell}
\alias{replaceRefDataWithAverageRefBiomeCell}
\title{Create modified MECO data file}
\usage{
replaceRefDataWithAverageRefBiomeCell(
dataFileIn,
dataFileOut,
biome_classes_in,
refBiom
)
replaceRefDataWithAverageRefBiomeCell(
dataFileIn,
dataFileOut,
......@@ -22,6 +29,11 @@ replaceRefDataWithAverageRefBiomeCell(
be compared to}
}
\description{
Function to create a modified MECO data file where each reference cell is
compared to the average reference biome cell. The scenario period is
overwritten with the original reference period and all reference cells are
set to the average cell of the prescribed reference biome refBiom
Function to create a modified MECO data file where each reference cell is
compared to the average reference biome cell. The scenario period is
overwritten with the original reference period and all reference cells are
......@@ -30,4 +42,6 @@ set to the average cell of the prescribed reference biome refBiom
\examples{
\dontrun{
}
\dontrun{
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment