View source: R/simple_inversion.R
| TS.inverse.simple | R Documentation |
Takes data TS and a data frame containing simulated TS at known Length and Orientation to find the closest matching parameters
TS.inverse.simple(TS.test, TS.sim, n.nf = 3)
TS.test |
Dataframe with TS values, where column names are the frequencies |
TS.sim |
Dataframe with modelled TS values, where each row is a sample and column names are the frequencies, the last columns contain the parameters |
n.nf |
number of factors contained within the data frame |
Sven Gastauer
#load data
data(TS_sim)
#select random row
rr<-sample(1:nrow(TS.sim),1)
TS.inv <- TS.inverse.simple(TS.test=TS.sim[rr,1:(length(TS.sim)-3)],
TS.sim=TS.sim,n.nf=3)
##########################################################
## CREATE PLOTS
##########################################################
ggplot(data=TS.inv,aes(x=L,y=theta,fill=log10(ss)))+
geom_raster(interpolate=TRUE)+
scale_fill_viridis(name="Log10(Sum of Squares)")+
scale_x_continuous(expand=c(0,0))+
xlab("Length [mm]")+
ylab(expression(paste("Incident Angle", theta, " [",degree,"]")))+
scale_y_continuous(expand=c(0,0))+
theme_minimal()+
theme(axis.text = element_text(size=16),
axis.title = element_text(size=18),
legend.position = "top")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.