Learn R Programming

atlantistools (version 0.4.3)

flip_layers: Flip layers for visualization.

Description

Within Atlantis the water column id 0 is the water column closest to the sediment. In order to simplify graphical interpretation of vertical plots this order is reversed. The surface layer is 1 by default. The sediment layer id is equal to the number of total layers. Please note that this is only used for graphical display.

Usage

flip_layers(data)

Arguments

data

dataframe with columns polygon and layer. layer id is based on atlantis output (0 = layer closest to the sediment)

Value

dataframe with flipped layerids. 1 = surface.

Examples

Run this code
# NOT RUN {
data <- rbind(expand.grid(species = "sp1", polygon = 0, layer = 0:7),
              expand.grid(species = "sp1", polygon = 1, layer = 0:4),
              expand.grid(species = "sp1", polygon = 2, layer = 0:2),
              expand.grid(species = "sp1", polygon = 3, layer = c(0:3, 7)))
data$atoutput <- runif(nrow(data), min = 0, max = 2)
flip_layers(data)
# }

Run the code above in your browser using DataLab