knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" )
All user-provided wavelengths must be given in meters.
You can install rindex from github with:
# install.packages("devtools") devtools::install_github("tjconstant/rindex")
library(rindex) rindex.search("silver")
Retrieving a dataset is done using the rindex.get()
function. You must specify the unique pageid
as found in the search table.
rindex.get(pageid = 1)
You can generate a spline-fit for any dataset using rindex.function()
. For example, to get the interpolated refractive index of silver at 633 nm,
Ag <- rindex.function(1) Ag(633e-9)
A comparison of dataset to spline-function is shown below.
Ag_data <- rindex.get(1) wavelengths <- seq(200,1900,, 100) * 1e-9 plot(Ag_data$wavelength, Ag_data$n, xlab = "wavelength (m) - log scale", ylab = "n", main = "Refractive Index of Silver (Real part)") lines(wavelengths, Re(Ag(wavelengths)), col = 2, lwd = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.