Learn R Programming

bSi (version 1.0.0)

plotStdC: Plot Silica Concentrations vs. Absorbance

Description

This function plots the Standard Calibration curves from known concentration of silica in standard solutions against absorbance values from spectrophotometer analysis. It takes Silica concentration values as Y argument and their absorbance values from spectrophotometer as X argument then creates a scatter plot, fits a line of best fit, and returns the y-intercept and R-squared values.

Usage

plotStdC(
  concentration,
  absorbance,
  title = "Concentration vs. Absorbance",
  xlab = "Absorbance",
  ylab = "Concentration (Millimoles)"
)

Value

A list with components:

  • intercept: The y-intercept of the fitted line.

  • rsquared: The R-squared value of the fitted line.

  • equation : The equation of the fitted line in the form y=mx+C

Arguments

concentration

A numeric vector of concentration values.

absorbance

A numeric vector of absorbance values.

title

A character string for the plot title.

xlab

A character string for the x-axis label.

ylab

A character string for the y-axis label.

Examples

Run this code

concentration <- c(1, 2, 3, 4, 5)
absorbance <- c(0.1, 0.3, 0.6, 0.8, 1.2)
plotStdC(concentration, absorbance,
          title = "Concentration vs. Absorbance",
          xlab = "Absorbance",
          ylab = "Concentrations")

Run the code above in your browser using DataLab