Description Usage Arguments See Also Examples
Generate a nutrient profile. The dependent variable (nutrients etc.) is on the x-axis and the independent variable (depth, pressure, etc.) is on the y-axis.
The y-axis is reversed so that the top of the y-axis is the water surface - typical in oceanography literature. The result of generateProfile
is stored in
in the global environment under plotx
where x
is a suffix indicating the plot number.
All measurements must be separated by a subset of some kind, whether that is the cast number or station number is up to you.
The function requires a subset because it must distinguish between different data points in order to draw different profiles. Otherwise all data points would be linked together. The subset you choose
can be restricted to particular subsets with the optional subsets
.
1 2 | generateProfile(depth_column, profile_columns, subset_column, subsets = z,
size = 3, lwd = 1.5)
|
depth_column |
Depth (or pressure) values. |
profile_columns |
Measurments. |
subset_column |
Variable to separate each measurement profile - usually station number or cast number. |
subsets |
Optional specification of which subsets you are interested in - i.e. stations 1, 2, 3, and 4. |
size |
Optional choice of point size in the depth profiles. |
lwd |
Optional choice of line width. |
http://ggplot2.tidyverse.org/reference/ for controlling plot parameters.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | library(oceanchemistry)
data("greenland", package = "oceanchemistry")
head(greenland)
#PLOT1 - no subsets specified#
generateProfile(greenland$Depth,
greenland$`NO2 + NO3 [umol/lg]`,
greenland$Station)
profile1 <- profile1 + xlab("Nitrate [umol/kg]")
print(profile1)
#PLOT2 - subsets specified#
generateProfile(greenland$Depth,
greenland$`NO2 + NO3 [umol/lg]`,
greenland$Station,
subsets = c(241,244))
profile1 <- profile1 + xlab("Nitrate [umol/kg]")
print(profile1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.