Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

GUI for fitting kinetic models to chemical degradation data with mkin

NotificationsYou must be signed in to change notification settings

jranke/gmkin

Repository files navigation

The R packagegmkinprovides a browser based graphical user interface (GUI) forfitting kinetic models to chemical degradation data based on R packagemkin. The GUI is based on thegWidgetsWWW2 package developed byJohn Verzani. The GUI elements are created by the JavaScript libraryExtJS which is bundled with gWidgetsWWW2.

System requirements

For running current gmkin you need a system running a recent version ofR (4.0.x, on Linux older versions may work as well), the gWidgesWWW2 package,the gmkin package and a web browser (Firefox and Chrome work for me) withJavaScript enabled.

It should be possible to run gmkin on most laptop or desktop computers runningLinux, Mac OS X, Windows 7 or Windows 10.

To view the complete set of widgets in the browser window without resizinganything, it needs a screen space of 1366x740 pixels.

Installing R

Please refer toCRAN for installation instructionsand binary packages. If you are on Windows, please consult theFAQ for Windows, especiallythe entries"How do I install R for Windows?","How do I run it?".

If you would like to upgrade your R installation, please refer to therespectiveFAQ entry.

Installing gmkin and gWidgetsWWW2

Windows and Linux users can make use of my dratpackage repository on github. Before installing gmkin, you should updateyour R packages already installed, e.g. by starting R, and pasting thecommand

update.packages()

or similar, depending on your R installation.

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

install.packages("drat")

add my repository

drat::addRepo("jranke")

and install as usual

install.packages("gmkin")

The latest changes to gmkin are recorded in theNEWS file,more details can be found in thecommit history.

gmkin screenshot

Usage

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

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 browseron Windows).

Documentation

For a complete overview of the functionality of the gmkin graphical userinterface please refer to themanualavailable at the gmkindocumentation website.

In case you would like to see the documentation of the underlying mkin package, pleaserefer to itsdocumentation website.

Status and known issues

  • gmkin was developed in the hope that it will be useful. However, no warranty can begiven that it will meet your expectations. There may be bugs, so please becareful, check your results for plausibility and use your own expertise to judgeyourself.
  • Starting the GUI takes some time. If the GUI does not come up after 10-15seconds, close your browser and start gmkin again using the command 'gmkin()'.Once the GUI is started, it is reasonably responsive.
  • Please check theissues reported on github
  • The R console starting the graphical user interface is not secured against manipulationsfrom local users on multiuser systems(seegWidgetsWWW2 issue).

Notes on the gWidgetsWWW2 package

The R package gWidgetsWWW2 is not available on CRAN because it containspath names with more then 100 characters in the JavaScript files which limitsits portability. Also, it attaches some R objects to the search path, which is,in its current form, not fully in line with the CRAN package policy. It is nota widely used library for creating graphical user interfaces and is not supportedby a commercial company. However it makes it possible to create a reasonablycomplex user interface by just writing R code, and is therefore used by gmkin.

Installation using the devtools package

Users of thedevtools package can also install gWidgetsWWW2 and gmkin directly fromthe 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 overlylong path names (see Notes on gWidgetsWWW2 above). Usingquick = TRUE skipsdocs, multiple-architecture builds, demos, and vignettes, to make installationas fast and painless as possible.

Simplifying the start of gmkin under Windows

You can put the commands

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

in an R script (e.g. underC:\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-4.x.y\bin\R.exe" --slave -f c:\Users\<your username>\AppData\Roaming\gmkin_start.R,where R-4.x.y is the version of R that you would like to use with gmkin. Thiswill start a non-interactive R console that runs the gmkin GUI. In theproperties dialogue of the shortcut, you can also set the working directory inwhich it starts gmkin. Thanks to Jonas Klein of the Umweltbundesamt for thetrick with using 'Sys.sleep' in a while loop and for suggesting the AppDatadirectory for the start script.

Caveat: The last time I tested this (13 February 2021), starting gmkin withsuch a shortcut slowed down the loading of the GUI elements significantly. Thiswas under Windows 10 64 bit. Therefore, for Windows I would currently recommendto start the R GUI application and start gmkin from there as described aboveunder 'Usage'.

Acknowledgements

Financial support, feedback and suggestions by the German Federal EnvironmentalAgency (Umweltbundesamt) in two projects in2014 and 2015 was crucial for reaching version 0.6.3 in November 2015 and isgratefully acknowledged. In particular, Stefan Meinecke contributed with a lotof user feedback and suggestions for improvement in that time.

The adaptation to mkin versions > 0.9.49.6 that can do fits using a two-componenterror model was supported by another project by the Umweltbundesamt in 2018/2019.

About

GUI for fitting kinetic models to chemical degradation data with mkin

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp