SCM

SCM Repository

[chemosensors] View of /pkg/man/demo-SensorNoise.Rd
ViewVC logotype

View of /pkg/man/demo-SensorNoise.Rd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (download) (as text) (annotate)
Wed Mar 2 14:48:07 2016 UTC (3 years, 1 month ago) by variani
File size: 1402 byte(s)
new Rd produced by roxygen2
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/demos.R
\docType{data}
\name{demo-SensorNoise}
\alias{demo-SensorNoise}
\title{Demo SensorNoise.}
\description{
Demo SensorNoise.
}
\examples{
# sensor array
sa <- SensorArray(tunit = 60, num = 1:2,
  csd = 2, ssd = 5, dsd = 1)

# concentration input
sc <- Scenario(T = c("A", "B", "C", "B, C"), tunit = tunit(sa))
conc <- getConc(sc)

# replicas of `sa`
sa1 <- sa
dsd(sa1) <- 0

sa2 <- sa
ssd(sa2) <- 0
dsd(sa2) <- 0

sa3 <- sa
csd(sa3) <- 0
ssd(sa3) <- 0
dsd(sa3) <- 0

# sensor array data
sdata0 <- predict(sa, conc = conc)
sdata1 <- predict(sa1, conc = conc)
sdata2 <- predict(sa2, conc = conc)
sdata3 <- predict(sa3, conc = conc)

# plot conc. matrix
mf <- melt(conc, varnames = c("sample", "gas"))
p1 <- ggplot(mf, aes(x = sample, y = value)) + geom_line(aes(color = gas))
p1

# plot sensor array data
mf0 <- melt(sdata0, varnames = c("sample", "sensor"))
mf1 <- melt(sdata1, varnames = c("sample", "sensor"))
mf2 <- melt(sdata2, varnames = c("sample", "sensor"))
mf3 <- melt(sdata3, varnames = c("sample", "sensor"))
mf <- rbind(data.frame(mf0, array = "default"), 
 data.frame(mf1, array = "csd/ssd"), 
 data.frame(mf2, array = "csd"),
 data.frame(mf3, array = "noise-free"))
   
p3 <- ggplot(mf, aes(x = sample, y = value)) + geom_line(aes(color = as.factor(sensor))) +
  facet_grid(array ~ .)
p3
}
\keyword{demo}


root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge