SCM

SCM Repository

[chemosensors] View of /pkg/man/scenario-methods.Rd
ViewVC logotype

View of /pkg/man/scenario-methods.Rd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 55 - (download) (as text) (annotate)
Wed Mar 2 14:48:07 2016 UTC (2 years, 11 months ago) by variani
File size: 6068 byte(s)
new Rd produced by roxygen2
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ChemosensorsClass.R, R/ChemosensorsClassMethods.R, R/ScenarioClass.R, R/ScenarioClassMethods.R, R/conc.lib.R, R/methods.R, R/sdata.lib.R
\docType{methods}
\name{scenario-methods}
\alias{add<-}
\alias{add<-,Scenario-method}
\alias{checkConc,ANY-method}
\alias{cmatrix,Scenario-method}
\alias{conc2col,ANY-method}
\alias{conc2df,ANY-method}
\alias{conc2glab,ANY-method}
\alias{conc2lab,ANY-method}
\alias{conc2tpoint,ANY-method}
\alias{getTPoint,ANY-method}
\alias{lab2df,Scenario-method}
\alias{label2df,Scenario-method}
\alias{nsamples,Scenario-method}
\alias{scenario-methods}
\alias{sdata.frame,ANY-method}
\alias{sdata.frame,Scenario-method}
\alias{sdata2df,ANY-method}
\alias{sdata2feature,ANY-method}
\alias{sdata2pulse,ANY-method}
\alias{set2lab,Scenario-method}
\title{Method sdata.frame.}
\usage{
sdata.frame(x, ...)

nsamples(x)

cmatrix(x, ...)

add(object) <- value

checkConc(object, conc, ...)

sdata2feature(object, conc, sdata, ...)

sdata2df(object, sdata, ...)

conc2df(object, conc, ...)

conc2lab(object, ...)

conc2glab(object, ...)

conc2col(object, ...)

getTPoint(object, conc, ...)

conc2tpoint(object, ...)

lab2df(object, ...)

label2df(object, ...)

set2lab(object, ...)

\S4method{sdata.frame}{ANY}(x, feature, df, ...)

\S4method{nsamples}{Scenario}(x)

\S4method{cmatrix}{Scenario}(x, ...)

\S4method{sdata.frame}{Scenario}(x, unique = FALSE, step = FALSE, ...)

\S4method{add}{Scenario}(object) <- value

\S4method{set2lab}{Scenario}(object, unique = FALSE, ...)

\S4method{lab2df}{Scenario}(object, lab, step = FALSE, ...)

\S4method{label2df}{Scenario}(object, value, nsamples = 0, step = FALSE,
  ...)

\S4method{checkConc}{ANY}(object, conc, ...)

\S4method{conc2df}{ANY}(object, conc, ...)

\S4method{conc2lab}{ANY}(object, ...)

\S4method{conc2glab}{ANY}(object, ...)

\S4method{conc2col}{ANY}(object, conc, pal, ...)

\S4method{conc2tpoint}{ANY}(object, conc, ...)

\S4method{getTPoint}{ANY}(object, conc, tpoint, ...)

\S4method{sdata2feature}{ANY}(object, conc, sdata, feature = "transient", cf,
  sf, ...)

\S4method{sdata2df}{ANY}(object, sdata, ...)

\S4method{sdata2pulse}{ANY}(object, conc, sdata, ...)
}
\description{
Method sdata.frame.

Method nsamples.

Method cmatrix.

Method add<-.

Method checkConc.

Method sdata2feature.

Method sdata2df.

Method conc2df.

Method conc2lab.

Method conc2glab.

Method conc2col.

Method getTPoint.

Method conc2tpoint.

Method lab2df.

Method label2df.

Method set2lab.

Method sdata.frame converts a concetration matrix and 
(optionally) a sensor data matrix into a data frame.

Method conc2df converts a concetration matrix into a data frame.

Methods to control the scenario.

Method sdata2feature converts a matrix of sensor data  into a data frame of features.

Method sdata2df converts a matrix of sensor data into a data frame.
}
\details{
The input parameters are an object, e.g. \code{SensorArray}, a concentration matrix,
and (optionally) a sensor data matrix.
The output data frame has the following columns:

\tabular{rl}{
  \code{S1}, \code{S2}, ... \tab Sensor signals. \cr
  \code{A}, \code{B}, ... \tab Gas concentrations (column names equal to gas names of the object). \cr
  \code{glab} \tab Gas labels, e.g. \code{A} or \code{Air}. \cr
  \code{lab} \tab Gas+Concetratoin labels, e.g. \code{A 0.01}. \cr
  \code{tpoint} \tab Time point labels to encode the gas pulses, e.g. \code{gasin}.
}

The input parameters are an object, e.g. \code{SensorArray}, and a concentration matrix.
The output data frame has the following columns:

\tabular{rl}{
  \code{A}, \code{B}, ... \tab Gas concentrations (column names equal to gas names of the object). \cr
  \code{glab} \tab Gas labels, e.g. \code{A} or \code{Air}. \cr
  \code{lab} \tab Gas+Concetratoin labels, e.g. \code{A 0.01}. \cr
  \code{tpoint} \tab Time point labels to encode the gas pulses, e.g. \code{gasin}.
}

The input parameters are an object, e.g. of class \code{SensorArray}, a concentration matrix,
a matrix of sensor data, and (optionally) a data frame derived from conccentraion matrix.

The input parameters are an object, e.g. of class \code{SensorArray}, and a matrix of sensor data.
}
\examples{
set.seed(1)

### 1) a concentration matrix of three gases (tunit 4)
sa <- SensorArray(tunit = 4)

set <- c("A 0.1", "B 0.1", "C 1")
sc <- Scenario(set, tunit = 4)
conc <- getConc(sc)

head(conc)

sdata <- predict(sa, conc)

p1 <- plotSignal(sa, conc = conc, sdata = sdata)
p1

# get a data.frame of features
df.transient <- sdata.frame(sa, conc = conc, sdata = sdata, feature = "transient")

df.ss <- sdata.frame(sa, conc = conc, sdata = sdata, feature = "steady-state")

df.step <- sdata.frame(sa, conc = conc, sdata = sdata, feature = "step")

# plot
p2 <- ggplot(df.transient, aes(x = 1:length(S1))) +
  geom_line(aes(y = S1, color = "S1")) +
  geom_line(aes(y = S2, color = "S2")) +
  labs(title = "feature: transient")
p2

df <- rbind(data.frame(df.ss, feature = "steady-state"),
  data.frame(df.step, feature = "step"))
  
p3 <- ggplot(df, aes(lab, S1, fill = feature)) + geom_bar(stat = "identity", position = "dodge")
p3

### 1) a concentration matrix of three gases (tunit 1)
sa <- SensorArray() 

conc.values <- concMax(sa)
conc <- diag(conc.values)

conc 

cf <- conc2df(sa, conc)
cf

### 2) a concentration matrix of three gases (tunit = 4)
sa <- SensorArray(tunit = 4)

set <- c("A 0.1", "B 0.1", "C 1")
sc <- Scenario(set, tunit = 4)
conc <- getConc(sc)

head(conc)

cf <- conc2df(sa, conc)
head(cf)

### 1) a concentration matrix of three gases (tunit 4)
sa <- SensorArray(tunit = 4)

set <- c("A 0.1", "B 0.1", "C 1")
sc <- Scenario(set, tunit = 4)
conc <- getConc(sc)

head(conc)

sdata <- predict(sa, conc)

df <- sdata2feature(sa, conc, sdata)
head(df)

### 1) a concentration matrix of three gases (tunit 4)
sa <- SensorArray(tunit = 4)

set <- c("A 0.1", "B 0.1", "C 1")
sc <- Scenario(set, tunit = 4)
conc <- getConc(sc)

head(conc)

sdata <- predict(sa, conc)

sf <- sdata2df(sa, sdata)

head(sf)
}


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