multiPlotSP: Plots several single-phase transport profiles overlayed

Description Usage Arguments Details Value Author(s) Examples

View source: R/multiPlotSP.R

Description

Given a list of several complete transport data, the function overlays the transport profiles in a defined phase. The function is useful in membrane reuse experiments as transport profile deterioration is easily visualized.

Usage

1
2
3
4
5
multiPlotSP(trans, phase = "strip", trend = NULL, legend = FALSE,
  xlab = "Time (h)", ylab = expression(Phi), xlim = NULL, ylim = NULL,
  xbreaks = NULL, ybreaks = NULL, size = 3, plot = TRUE, shape = 15,
  bw = FALSE, arw = FALSE, arw.pos = NULL, arw.txt = NULL,
  txt.pos = NULL, txt.size = NULL)

Arguments

trans

List of data frames with the complete transport information of interest species. Must be generated using conc2frac. This is the only non-optional parameter.

phase

Phase to be represented in the plot: 'strip', the default, or 'feed'.

trend

List of Non-linear regression models of the main species transport profil. Generated using transTrend.

legend

Logical. If FALSE, the default, the legend is not included.

xlab

Label to be used for x axis. Text and expression allowed.

ylab

Label to be used for y axis. Text and expression allowed.

xlim

Numeric vector of limits for X-axis.

ylim

Numeric vector of limits for X-axis.

xbreaks

Numeric vector of x-axis breaks.

ybreaks

Numeric vector of x-axis breaks.

size

Size used for points in the plot.

plot

Logical. If TRUE, the default, the plot is printed in the current graphical device.

shape

Shape to use in the points to be plotted.

bw

Logical, if FALSE, the default, a color version of the plot is given. If a black and white version is required, it must be set to TRUE.

arw

Logical default to FALSE. If TRUE, a vertical arrow is drawn in the plot. Its use is recommended when a trend along the profiles is to be indicated.

arw.pos

Numeric vector of the coordinates of the arrow if arw = TRUE. The format is (x0, x1, y0, y1)

arw.txt

Text to be (optionally) printed alongside the arrow.

txt.pos

Numeric vector of the position of the center of the text provided in arw.txt. The format is (x, y). If not provided, the text is located close to the arrow but a little alignment could be required.

txt.size

Size of the text accompanying the arrow.

Details

Most transmem graphical representations are made using the package ggplot2 so the function returns a ggplot2 object that can be assigned to a variable for further modification.

Value

Plot with the overlayed transport profiles for a single phase

Author(s)

Cristhian Paredes, craparedesca@unal.edu.co

Eduardo Rodriguez de San Miguel, erdsmg@unam.mx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  data(reusecycles)
  # First step is to get trend lines for each cycle:
  trend <- list()
  for (i in 1:length(reusecycles)) {
    trend[[i]] <- transTrend(trans = reusecycles[[i]])
  }
  # Default plot using colors:
  multiPlotSP(trans = reusecycles, trend = trend, legend = TRUE)

  # Black and white plot including an arrow:
  multiPlotSP(trans = reusecycles, trend = trend, legend = TRUE, bw = TRUE,
              arw = TRUE, arw.pos = c(6.1, 6.1, 0.8, 0.6),
              arw.txt = 'Cycle', txt.pos = c(6.15, 0.7))

transmem documentation built on July 1, 2020, 10:38 p.m.