summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2012-08-23 07:36:58 +0000
committerjranke <jranke@edb9625f-4e0d-4859-8d74-9fd3b1da38cb>2012-08-23 07:36:58 +0000
commit6be6c3d60131e8f482394dbbadcf1bfa84f4e721 (patch)
tree16409b5326f914fe6bc99242208d9f652269b852
parent1f389a7b1fa4928785a1d309f9a08c6ebf803056 (diff)
Fixes and improvements of kinobject and kinobjects functions
git-svn-id: svn+ssh://svn.r-forge.r-project.org/svnroot/kinfit/pkg/kinfit@55 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
-rw-r--r--DESCRIPTION4
-rw-r--r--R/kinobject.R6
-rw-r--r--R/kinobjects.R7
-rw-r--r--man/kinobject.Rd1
-rw-r--r--man/kinobjects.Rd1
5 files changed, 8 insertions, 11 deletions
diff --git a/DESCRIPTION b/DESCRIPTION
index a89f5d8..439800b 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
Package: kinfit
Type: Package
Title: Routines for fitting kinetic models to chemical degradation data
-Version: 1.1.09
-Date: 2012-06-30
+Version: 1.1.10
+Date: 2012-08-23
Author: Johannes Ranke and Katrin Lindenberger
Maintainer: Johannes Ranke <jranke@uni-bremen.de>
Description: Simple calculation routines based on the FOCUS Kinetics
diff --git a/R/kinobject.R b/R/kinobject.R
index 2ecc962..5fc715e 100644
--- a/R/kinobject.R
+++ b/R/kinobject.R
@@ -19,13 +19,11 @@
# this program. If not, see <http://www.gnu.org/licenses/>
kinobject <- function(parent, type, system,
- layers = NA, sampling_times = NA)
+ layers = NA, sampling_times = NA, replicates = 1)
{
kinobject <- list(parent = parent,
type = type, system = system)
if (!is.na(layers[1])) kinobject$layers = layers
- if (!is.na(sampling_times[1])) {
- kinobject$sampling_times = layers
- }
+ kinobject$data <- data.frame(t = rep(sampling_times, each = replicates), parent = NA)
return(kinobject)
}
diff --git a/R/kinobjects.R b/R/kinobjects.R
index 33abe61..c191c70 100644
--- a/R/kinobjects.R
+++ b/R/kinobjects.R
@@ -19,16 +19,13 @@
# this program. If not, see <http://www.gnu.org/licenses/>
kinobjects<- function(parent, type, systems,
- layers = NA, sampling_times = NA)
+ layers = NA, sampling_times = NA, replicates = 1)
{
kinobjects <- list()
for (system in systems) {
kinobjects[[system]] <- kinobject(parent = parent,
- type = type, system = system)
+ type = type, system = system, sampling_times = sampling_times, replicates = replicates)
if (!is.na(layers[1])) kinobjects[[system]]$layers = layers
- if (!is.na(sampling_times[1])) {
- kinobjects[[system]]$sampling_times = layers
- }
}
return(kinobjects)
}
diff --git a/man/kinobject.Rd b/man/kinobject.Rd
index c5c5f77..c75f17f 100644
--- a/man/kinobject.Rd
+++ b/man/kinobject.Rd
@@ -16,6 +16,7 @@ Function to initialise an object representing a kinetic experiment or trial.
\item{system}{ System name. Important if several systems were used, e.g. several soils. }
\item{layers}{ Optional specification of the layer names in a field trial. }
\item{sampling_times}{ Optional specification of the sampling time points. }
+ \item{replicates}{ Optional specification of the number of replicates at each sampling time point. }
}
\value{
A list containing the specified information.
diff --git a/man/kinobjects.Rd b/man/kinobjects.Rd
index cbc46aa..923b219 100644
--- a/man/kinobjects.Rd
+++ b/man/kinobjects.Rd
@@ -16,6 +16,7 @@ Function to initialise several objects representing a kinetic experiment or tria
\item{systems}{ An array of the system names }
\item{layers}{ Optional specification of the layer names in a field trial. }
\item{sampling_times}{ Optional specification of the sampling time points. }
+ \item{replicates}{ Optional specification of the number of replicates at each sampling time point. }
}
\value{
A list of lists containing the specified information.

Contact - Imprint