From ba0ffaa9579322d0dca4973b4750432fccd3e83b Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 12 Feb 2021 17:41:38 +0100 Subject: Adapt to mkin 1.0.x, rebuild docs --- .Rbuildignore | 1 + DESCRIPTION | 8 +- NEWS.md | 6 + data/FOCUS_2006.RData | Bin 16021 -> 4268 bytes docs/404.html | 41 ++++-- docs/articles/gmkin_manual.html | 141 +++++++++--------- .../accessible-code-block-0.0.1/empty-anchor.js | 15 ++ .../header-attrs-2.6/header-attrs.js | 12 ++ docs/articles/index.html | 42 +++--- docs/authors.html | 35 +++-- docs/bootstrap-toc.css | 60 ++++++++ docs/bootstrap-toc.js | 159 +++++++++++++++++++++ docs/index.html | 59 ++++---- docs/news/index.html | 49 ++++--- docs/pkgdown.css | 125 +++++++++++++++- docs/pkgdown.js | 5 - docs/pkgdown.yml | 5 +- docs/reference/FOCUS_2006.html | 57 ++++---- docs/reference/FOCUS_2006_Z.html | 57 ++++---- docs/reference/Rplot001.png | Bin 0 -> 1011 bytes docs/reference/UBA_model_gallery.html | 53 +++---- docs/reference/gmkin.html | 55 +++---- docs/reference/gmkinws.html | 51 ++++--- docs/reference/index.html | 49 ++++--- vignettes/gmkin_manual.Rmd | 2 + vignettes/gmkin_manual.html | 118 +++++++++------ 26 files changed, 844 insertions(+), 361 deletions(-) create mode 100644 docs/articles/gmkin_manual_files/accessible-code-block-0.0.1/empty-anchor.js create mode 100644 docs/articles/gmkin_manual_files/header-attrs-2.6/header-attrs.js create mode 100644 docs/bootstrap-toc.css create mode 100644 docs/bootstrap-toc.js create mode 100644 docs/reference/Rplot001.png diff --git a/.Rbuildignore b/.Rbuildignore index c9e467f..e7f0084 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,6 +1,7 @@ ^GNUmakefile$ ^README.html$ ^gmkin_.*\.tar\.gz$ +^gmkin\.tar$ ^gmkin_.*\.zip$ ^gmkin_screenshot.png$ ^Rprofile$ diff --git a/DESCRIPTION b/DESCRIPTION index 9316135..c039c67 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: gmkin Type: Package Title: Graphical User Interface for Fitting Kinetic Models to Chemical Degradation Data -Version: 0.6.10 -Date: 2019-07-08 +Version: 0.6.11 +Date: 2021-02-21 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de"), person("Stefan", "Meinecke", role = "ctb"), @@ -10,7 +10,7 @@ Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), Description: Browser based graphical user interface for R package mkin, based on the gWidgetsWWW2 package. Both gmkin and gWidgetsWWW2 are developed on GitHub, but are also available from the R-Forge repository. -Depends: mkin (>= 0.9.49.6), gWidgetsWWW2 (>= 0.4-7) +Depends: R (>= 3.5.0), mkin (>= 1.0.1), gWidgetsWWW2 (>= 0.4-7) Imports: R6, markdown, plyr, devEMF Suggests: knitr, rmarkdown License: GPL @@ -20,4 +20,4 @@ Encoding: UTF-8 VignetteBuilder: knitr BugReports: http://github.com/jranke/gmkin/issues URL: http://pkgdown.jrwb.de/gmkin -RoxygenNote: 6.1.1 +RoxygenNote: 7.1.1 diff --git a/NEWS.md b/NEWS.md index 1dd1be6..c4915bc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,11 @@ # NEWS for package 'gmkin' +## gmkin 0.6-11 (2021-02-21) + +- Adapt built-in 'FOCUS_2006' workspace to mkin 1.0.x as we have now have the 'deg_func' element in 'mkinmod' objects + +- The three HOWTO tests in the manual pass + ## gmkin 0.6-10 (2019-07-09) - Adapt to mkin 0.9.49.6, making the new way to fit variance by variable and the two-component error model available to gmkin diff --git a/data/FOCUS_2006.RData b/data/FOCUS_2006.RData index 27520b4..a2641e2 100644 Binary files a/data/FOCUS_2006.RData and b/data/FOCUS_2006.RData differ diff --git a/docs/404.html b/docs/404.html index 80f880b..12b760a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -75,7 +79,7 @@
@@ -120,6 +129,12 @@ Content not found. Please use links in the navbar. + + @@ -130,7 +145,7 @@ Content not found. Please use links in the navbar.
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.6.1.

diff --git a/docs/articles/gmkin_manual.html b/docs/articles/gmkin_manual.html index a562df3..cad446a 100644 --- a/docs/articles/gmkin_manual.html +++ b/docs/articles/gmkin_manual.html @@ -6,19 +6,19 @@ Manual for gmkin • gmkin - - - - + + + + + - - + - +
@@ -72,15 +79,15 @@ -
+
@@ -97,16 +104,18 @@

Starting gmkin

As gmkin is an R package, you need to start R and load the gmkin package before you can run gmkin. The latter can be achieved by entering the command

-
library(gmkin)
+

into the R console. This will also load the packages that gmkin depends on, most notably gWidgetsWWW2 and mkin. Loading the package only has to be done once after you have started R.

Before you start gmkin, you should make sure that R is using the working directory that you would like to keep your gmkin project file(s) in. If you use the standard R GUI application on windows, you can change the working directory from the File menu (‘File’ -> ‘Change dir…’).

Once you are sure that the working directory is what you want it to be, gmkin can be started by entering the R command

- +

This will cause the default browser to start up or, if it is already running, to pop up and open a new tab for displaying the gmkin user interface.

In the R console, you should see a message that the httpd help server is started, if it wasn’t already started before.

In the browser, you should see something like the screenshot below.

-Screenshot of the newly started gmkin GUI

Screenshot of the newly started gmkin GUI

+

Screenshot of the newly started gmkin GUI

The statusbar at the bottom of the gmkin window shows, among others, the working directory that gmkin uses.

If the browser only shows “Loading ExtJS…” and nothing else happens for about 10 to 15 seconds, please enter the gmkin() command again in the R console. If this still does not bring up the gmkin GUI, please close the browser and try again.

@@ -124,16 +133,16 @@

A gmkin project workspace contains datasets, kinetic models for fitting, and so-called fits, i.e. the results of fitting models to data. The project area also shows the current working directory, where project workspace files are saved using the file extension .gmkinws.

Once a project has been saved by the user, the project explorer to the left will show it in the project list.

-Screenshot of saving a new project

Screenshot of saving a new project

+

Screenshot of saving a new project

The current state of a project should repeatedly be saved during the work in order to avoid loosing data. This can be achieved by selecting the ‘Project’ tab in the center and pressing the ‘Save project to project file’ button. More conveniently, the keyboard shortcut Shift-F12 (was Ctrl-X in gmkin < 0.6.6) can be used to save the current status of the project.

In the project file management area, datasets and models can be imported from one of the projects in the project list, once it has been selected in the droplist labelled ‘Import from:’.

-Screenshot of importing datasets and models

Screenshot of importing datasets and models

+

Screenshot of importing datasets and models

Once the project has been set up, you may want to minimize the project explorer, especially if you are limited in vertical screen space.

-Screenshot of minimized project explorer

Screenshot of minimized project explorer

+

Screenshot of minimized project explorer

@@ -141,7 +150,7 @@ Dataset editor

When you select one of the datasets in the dataset explorer to the left, some summary information about the dataset is shown in the center, and the data itself is loaded into the data editor to the right.

-Screenshot of the GUI after loading a dataset

Screenshot of the GUI after loading a dataset

+

Screenshot of the GUI after loading a dataset

When you have added information about the units, or edited the data to the right, you should hit the button ‘Keep changes’. This will add a new entry in the dataset explorer.

In the dataset editor to the right, you can override original data (for example in order to follow FOCUS recommendations for time zero samples or values below the limit of detection) by entering numbers in the override column.

@@ -150,10 +159,10 @@

Entering data directly

-

For entering new data manually, there are two possibilities. You can either change the Dataset title of the current dataset and edit the data in the Data editor to the right. Or, if the new data should have a different structure, e.g. different sampling times, observed variables and replicates, click on “New dataset”, edit the dataset title, sampling times, number of replicates and the list of observed variables, and press the button ‘Generate grid for entering kinetic data’, in order to prepare the Data editor to the right.

+

For entering new data manually, there are two possibilities. You can either change the Dataset title of the current dataset and edit the data in the Data editor to the right. Or, if the new data should have a different structure, e.g. different sampling times, observed variables and replicates, click on “New dataset”, edit the dataset title, sampling times, number of replicates and the list of observed variables, and press the button ‘Generate grid for entering kinetic data’, in order to prepare the Data editor to the right.

For sampling times and short names of the relevant compounds, a comma separated list must be entered, with a space after each comma. An example of filling out the respective fields is shown below.

-Screenshot of generating a data grid

Screenshot of generating a data grid

+

Screenshot of generating a data grid

After that, the actual measurements can be entered into the Data editor to the right, in the column ‘value’.

If everything is OK, press “Keep changes” to save the dataset in the current workspace. Note that you need to save the project file (see above) in order to be able to use the dataset that you created in a future gmkin session.

@@ -163,17 +172,18 @@ Importing data from text files

In case you want to work with a larger dataset that is already available as a computer file e.g. in a spreadsheet application, you can export these data as a tab separated or comma separated text file and import it using the “Browse” and “Upload” buttons in the dataset editor.

As an example, we can create a text file from one of the datasets shipped with the mkin package using the following R command:

-
write.table(schaefer07_complex_case, sep = ",", dec = ".",
-            row.names = FALSE, quote = FALSE,
-            file = "schaefer07.csv")
+
+write.table(schaefer07_complex_case, sep = ",", dec = ".",
+            row.names = FALSE, quote = FALSE,
+            file = "schaefer07.csv")

This produces a text file with comma separated values in the current working directory of R.

Loading this text file into gmkin using the “Browse” and “Upload” buttons

-Screenshot of the browse and upload dialogue

Screenshot of the browse and upload dialogue

+

Screenshot of the browse and upload dialogue

results in an an import configuration area showing the top lines of the imported file, and giving the possibility to chose the import options matching the file format.

-Screenshot of the import configuration area

Screenshot of the import configuration area

+

Screenshot of the import configuration area

In the import configuration area, the following options can be specified. In the field “Comment lines”, the number of lines in the beginning of the file that should be ignored can be specified.

The checkbox on the next line should be checked if the first line of the file contains the column names, i.e. the names of the observed variables when the data are in wide format.

@@ -181,11 +191,11 @@

As the “Decimal” separator, comma “,” or period “.” can be selected.

In the next line, it can be specified if the data are in wide or in long format. If in wide format, the only option left to specify is the title of the column containing the sampling times. If the data is in long format, the column headings specifying the columns containing the observed variables (default is “name”), the sampling times (default is “time”), the observed values (default is “value”) and, if present in the data, the relative errors (default is “err”) can be adapted. The default settings appearing if the long format is selected are shown below.

-Screenshot of the default variable names for data in long format

Screenshot of the default variable names for data in long format

+

Screenshot of the default variable names for data in long format

In our example we have data in the wide format, and after adapting the “Separator” to a comma, we can press the button “Import using options specified below”, and the data should be imported. If successful, the dataset editor should show the sampling times and the names of the observed variables, and the Data editor should show the imported data in a grid for further editing or specifying overrides.

-Screenshot of a successful upload

Screenshot of a successful upload

+

Screenshot of a successful upload

After adapting the dataset title and possibly the units, press “Keep changes” to save the dataset in the current workspace. Again, you need to save the project file in order to be able to use the dataset that you created in a future gmkin session.

@@ -195,10 +205,10 @@ Model editor

The following screenshot shows the model editor for the model ‘Z.2a.ff’ from the project workspace ‘FOCUS_2006_Z’ provided with the gmkin package.

-Screenshot of the model editor

Screenshot of the model editor

+

Screenshot of the model editor

In the first line the name of the model can be edited. You can also specify “min” or “max” for minimum or maximum use of formation fractions. Maximum use of formation fractions means that the differential equations in the degradation model are formulated using formation fractions. When you specify “min”, then formation fractions are only used for the parent compound when you use the FOMC, DFOP or the HS model for it.

-

Pressing “Add observed variable” adds a line in the array of state variable specifications below. The observed variables to be added are usually transformation products (usually termed metabolites), but can also be the parent compound in a different compartment (e.g. “parent_sediment”).

+

Pressing “Add observed variable” adds a line in the array of state variable specifications below. The observed variables to be added are usually transformation products (usually termed metabolites), but can also be the parent compound in a different compartment (e.g. “parent_sediment”).

Only observed variable names that occur in previously defined datasets or models can be selected. For any observed variable other than the first one, only the SFO or the SFORB model can be selected. For each observed variables, a comma separated list of target variables can be specified. In addition, a pathway to the sink compartment can be selected. If too many observed variables have been added, complete lines can be removed from the model definition by pressing the button “Remove observed variable”.

If the model definition is supposedly correct, press “Keep changes” to make it possible to select it for fitting in the listing of models to the left.

@@ -208,7 +218,7 @@

If a dataset and a kinetic model are selected, the button “Configure fit” below in the Explorer window “Configuration” becomes active. Pressing it opens the “Configuration” area in the center and loads the dataset into the Data editor to the right, for viewing only.

After pressing the button ‘Plot unoptimised’, the data and the kinetic model with default starting parameters are plotted in the ‘Plot’ area to the right.

-Screenshot of the fit configuration area

Screenshot of the fit configuration area

+

Screenshot of the fit configuration area

@@ -226,7 +236,7 @@ Plot options

In the right part of the fit configuration area, the file format can be chosen, the legend can be turned off, and the observed variables for which the data and the model fit should be plotted can be selected as shown below.

-plot options

plot options

+

plot options

On systems running the Windows operating system, the enhanced metafile (emf) format can be additionally chosen. Changing the file format for plotting will also change the extension of the proposed filename for saving the plot.

@@ -242,25 +252,25 @@

Fitting the model

In many cases the starting parameters and the fit options do not need to be modified and the model fitting process can simply be started by pressing the “Run fit” button. In the R console, the progressive reduction in the model cost can be monitored and will be displayed in the following way:

- +
> Ordinary least squares optimisation
+Sum of squared residuals at call 1: 2388.077
+Sum of squared residuals at call 3: 2388.077
+Sum of squared residuals at call 4: 247.1962
+Sum of squared residuals at call 7: 200.6791
+Sum of squared residuals at call 10: 197.7231
+Sum of squared residuals at call 11: 197.0872
+Sum of squared residuals at call 14: 196.535
+Sum of squared residuals at call 15: 196.535
+Sum of squared residuals at call 16: 196.535
+Sum of squared residuals at call 17: 196.5334
+Sum of squared residuals at call 20: 196.5334
+Sum of squared residuals at call 25: 196.5334
+Negative log-likelihood at call 31: 26.64668
+Optimisation successfully terminated.

If plotting of the fitting progress was selected, a new separate graphics window should either pop up, or a graphics window previously started for this purpose will be reused.

If your screen size allows for it, you can arrange the R plotting window and the R console in a way that you can see everything at the same time:

-Screenshot of arrangement of plot window and console

Screenshot of arrangement of plot window and console

+

Screenshot of arrangement of plot window and console

@@ -269,20 +279,20 @@ Results and summary

Once a fit has successfully been completed, the most important results are shown in several tables in the “Result” area as shown below.

-Screenshot of the results

Screenshot of the results

+

Screenshot of the results

The detailed summary can be accessed below these tables.

-Screenshot of the summary

Screenshot of the summary

+

Screenshot of the summary

The complete summary can be saved into a text file by specifying a suitable file name and pressing the button “Save summary”.

Confidence interval plots

Whenever a new fit has been configured or a run of a fit has been completed, the plotting area is updated with the abovementioned plot of the data and the current model solution.

-

In addition, a confidence interval plot is shown below this conventional plot. In case a fit has been run and confidence intervals were successfully calculated for the fit ( i.e. if the model was not overparameterised and no other problems occurred), the confidence intervals are graphically displayed as bars as shown below.

+

In addition, a confidence interval plot is shown below this conventional plot. In case a fit has been run and confidence intervals were successfully calculated for the fit (i.e. if the model was not overparameterised and no other problems occurred), the confidence intervals are graphically displayed as bars as shown below.

-confidence

confidence

+

confidence

@@ -303,6 +313,8 @@
  • In the pop-up window that appears, press ‘Yes’
  • In the result viewer in the center, press ‘Keep fit’
  • Switch to the Project editor in the center
  • +
  • Check that the working directory is OK for writing a test project
  • +
  • If not, enter a suitable path (e.g. “~” which will be resolved to your home directory) and press ‘Change’
  • In the project explorer, enter the project name ‘Howto test 1’
  • Press ‘Save project to project file’
  • @@ -373,24 +385,11 @@ - @@ -401,7 +400,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/articles/gmkin_manual_files/accessible-code-block-0.0.1/empty-anchor.js b/docs/articles/gmkin_manual_files/accessible-code-block-0.0.1/empty-anchor.js new file mode 100644 index 0000000..ca349fd --- /dev/null +++ b/docs/articles/gmkin_manual_files/accessible-code-block-0.0.1/empty-anchor.js @@ -0,0 +1,15 @@ +// Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> +// v0.0.1 +// Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. + +document.addEventListener('DOMContentLoaded', function() { + const codeList = document.getElementsByClassName("sourceCode"); + for (var i = 0; i < codeList.length; i++) { + var linkList = codeList[i].getElementsByTagName('a'); + for (var j = 0; j < linkList.length; j++) { + if (linkList[j].innerHTML === "") { + linkList[j].setAttribute('aria-hidden', 'true'); + } + } + } +}); diff --git a/docs/articles/gmkin_manual_files/header-attrs-2.6/header-attrs.js b/docs/articles/gmkin_manual_files/header-attrs-2.6/header-attrs.js new file mode 100644 index 0000000..dd57d92 --- /dev/null +++ b/docs/articles/gmkin_manual_files/header-attrs-2.6/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/index.html b/docs/articles/index.html index 261fa76..6c915b0 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
    @@ -75,7 +79,7 @@
    @@ -120,9 +129,10 @@

    All vignettes

    - +
    +
    Manual for gmkin
    +
    +
    @@ -134,7 +144,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/authors.html b/docs/authors.html index b5c6fb1..9cd757e 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
    @@ -75,7 +79,7 @@
    @@ -143,7 +152,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index 6936d50..229d914 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,21 +6,21 @@ Graphical User Interface for Fitting Kinetic Models to Chemical Degradation Data • gmkin - - - - + + + + + - - +
    @@ -96,14 +103,14 @@

    Installing gmkin and gWidgetsWWW2

    Windows and Linux users running R 3.1.0 or later can make use of my drat package repository on github. Before installing gmkin, you should update your R packages already installed, e.g. by starting R, and pasting the command

    -
    update.packages()
    +
    update.packages()

    or similar, depending on your R installation.

    For installing gmkin or upgrading to the latest released version, please install the drat package

    -
    install.packages("drat")
    +
    install.packages("drat")

    add my repository

    -
    drat::addRepo("jranke")
    +
    drat::addRepo("jranke")

    and install as usual

    -
    install.packages("gmkin")
    +
    install.packages("gmkin")

    The latest changes to gmkin are recorded in the NEWS file, more details can be found in the commit history.

    gmkin screenshot

    @@ -112,8 +119,8 @@

    Usage

    Without further preparation, you can start the GUI by starting R and pasting the following commands into the R terminal (R console on Windows):

    -
    require(gmkin)
    -gmkin()
    +
    require(gmkin)
    +gmkin()

    You may also want to adapt the browser that R starts (using e.g. options(browser="/usr/bin/firefox") on linux, or setting the default browser on Windows).

    @@ -140,9 +147,9 @@

    Installation using the devtools package

    Users of the devtools package can also install gWidgetsWWW2 and gmkin directly from the respective github repositories:

    - +
    require(devtools)
    +install_github("jverzani/gWidgetsWWW2", quick = TRUE)
    +install_github("jranke/gmkin", quick = TRUE)

    Installing gWidgetsWWW2 in this way yields a lot of warnings concerning overly long path names (see Notes on gWidgetsWWW2 above). Using quick = TRUE skips docs, multiple-architecture builds, demos, and vignettes, to make installation as fast and painless as possible.

    @@ -150,11 +157,11 @@

    Simplifying the start of gmkin under Windows

    You can put the commands

    -
    require(gmkin)
    -gmkin()
    -while (TRUE) {
    -  Sys.sleep(10)
    -}
    +
    require(gmkin)
    +gmkin()
    +while (TRUE) {
    +  Sys.sleep(10)
    +}

    into an R script (e.g. under C:\Users\<your username>\AppData\Roaming\gmkin_start.R), and create a Windows shortcut, e.g. on the Desktop, with the target "C:\Program Files\R\R-3.x.y\bin\R.exe" --slave -f c:\Users\<your username>\AppData\Roaming\gmkin_start.R, where R.x.y is the version of R that you would like to use with gmkin. This will start a non-interactive R console that runs the gmkin GUI. In the properties dialogue of the shortcut, you can also set the working directory in which it starts gmkin. Thanks to Jonas Klein of the Umweltbundesamt for the trick with using Sys.sleep in a while loop and for suggesting the AppData directory for the start script.

    @@ -166,10 +173,12 @@
    - - @@ -168,7 +173,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/FOCUS_2006_Z.html b/docs/reference/FOCUS_2006_Z.html index 6901f59..4b8555b 100644 --- a/docs/reference/FOCUS_2006_Z.html +++ b/docs/reference/FOCUS_2006_Z.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -77,7 +80,7 @@
    @@ -124,7 +132,7 @@

    Data taken from FOCUS (2006), Appendix 7, p. 350.

    -
    FOCUS_2006_Z
    +
    FOCUS_2006_Z

    Format

    @@ -140,19 +148,16 @@ http://esdac.jrc.ec.europa.eu/projects/degradation-kinetics

    Examples

    -
    if (FALSE) { - save(FOCUS_2006_Z, file = "FOCUS_2006_Z.RData") +
    if (FALSE) { + save(FOCUS_2006_Z, file = "FOCUS_2006_Z.RData") # Now you can load the file "FOCUS_2006_Z.RData" from gmkin - }
    + } +
    - @@ -163,7 +168,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 0000000..17a3580 Binary files /dev/null and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/UBA_model_gallery.html b/docs/reference/UBA_model_gallery.html index 1e8abd8..4e7cce1 100644 --- a/docs/reference/UBA_model_gallery.html +++ b/docs/reference/UBA_model_gallery.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -42,7 +46,6 @@ GUI to see their definitions. The models use the topology of the models defined by Michael Klein (2010) for DegKinManager, with the exception of the kinetic sorption model." /> - @@ -60,7 +63,7 @@ - +
    @@ -82,7 +85,7 @@
    @@ -134,7 +142,7 @@ kinetic sorption model.

    -
    data("UBA_model_gallery")
    +
    data("UBA_model_gallery")

    Format

    @@ -150,16 +158,13 @@ Neustadt/Wstr.

    Examples

    -
    data(UBA_model_gallery)
    +
    data(UBA_model_gallery) +
    - @@ -170,7 +175,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/gmkin.html b/docs/reference/gmkin.html index fa33831..c4226b3 100644 --- a/docs/reference/gmkin.html +++ b/docs/reference/gmkin.html @@ -6,27 +6,31 @@ -Start a graphical user interface (GUI) based on the <code>gWidgetsWWW2</code> toolkit. — gmkin • gmkin +Start a graphical user interface (GUI) based on the gWidgetsWWW2 toolkit. — gmkin • gmkin - + - + - + + + + + - - + + - + - - + + @@ -35,11 +39,10 @@ - + - @@ -57,7 +60,7 @@ for an explanation how this toolkit works." /> - +
    @@ -79,7 +82,7 @@ for an explanation how this toolkit works." />
    @@ -118,7 +126,7 @@ for an explanation how this toolkit works." />
    @@ -128,7 +136,7 @@ for an explanation how this toolkit works." /> for an explanation how this toolkit works.

    -
    gmkin(script_name, show.log = FALSE)
    +
    gmkin(script_name, show.log = FALSE)

    Arguments

    @@ -153,13 +161,10 @@ Rook apps.

    app (a GWidgetsApp object) is returned.

    - @@ -170,7 +175,7 @@ Rook apps.

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/gmkinws.html b/docs/reference/gmkinws.html index 7d3b2a0..53b093f 100644 --- a/docs/reference/gmkinws.html +++ b/docs/reference/gmkinws.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -77,7 +80,7 @@
    @@ -124,7 +132,7 @@

    Datasets, models and fits are stored in lists.

    -
    gmkinws
    +
    gmkinws

    Format

    @@ -134,7 +142,7 @@ -
    +
    observed

    Names of the observed variables in the datasets, named by the names used in the models contained in field m

    @@ -147,13 +155,10 @@ by the names used in the models contained in field m

    - @@ -164,7 +169,7 @@ by the names used in the models contained in field m

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/docs/reference/index.html b/docs/reference/index.html index c96681b..d16dfb6 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
    @@ -75,7 +79,7 @@
    @@ -131,6 +140,11 @@

    + + +
    + +
    @@ -166,11 +180,10 @@
    - @@ -181,7 +194,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.6.1.

    diff --git a/vignettes/gmkin_manual.Rmd b/vignettes/gmkin_manual.Rmd index 26ebe4d..f076c55 100644 --- a/vignettes/gmkin_manual.Rmd +++ b/vignettes/gmkin_manual.Rmd @@ -411,6 +411,8 @@ before releasing a new version. - In the pop-up window that appears, press 'Yes' - In the result viewer in the center, press 'Keep fit' - Switch to the Project editor in the center +- Check that the working directory is OK for writing a test project +- If not, enter a suitable path (e.g. "~" which will be resolved to your home directory) and press 'Change' - In the project explorer, enter the project name 'Howto test 1' - Press 'Save project to project file' diff --git a/vignettes/gmkin_manual.html b/vignettes/gmkin_manual.html index e9f2bca..c285abf 100644 --- a/vignettes/gmkin_manual.html +++ b/vignettes/gmkin_manual.html @@ -1,20 +1,33 @@ - + - + - + Manual for gmkin + + + + - - @@ -399,7 +410,7 @@ $(document).ready(function () {

    Manual for gmkin

    Johannes Ranke

    -

    2019-07-09

    +

    2021-02-12

    @@ -409,21 +420,25 @@ $(document).ready(function () {
  • Starting gmkin
  • Three column layout
  • Project file management
  • -
  • Dataset editor