2024/02/24
Package compiled and checked with R 4.3.2
Fix a bug in causing .macroReadBin() to fail when non-UTF-8 characters are present in column names (error arrising with sub()). WARNING column names may changes after this update.
2018/11/19 All example/test binary files were updated. FOCUS dummy substance GW-C was replaced by GW-D with application every year, every other year or every third year, so these configurations are tested too.
2018/11/21 In macroutilsFocusGWConc(), use signif() instead of own code to round concentrations like MACRO In FOCUS user interface, i.e. with 3 significant figures rather than a number of digits after the decimal mark.
2018/12/06 Removed non-essential tests (comparison between bin-files imported by macroutils2 and converted by MACRO 5.2, for biennial and triennial application intervals). This saves space in the binary-package and is covered by the test for annual application.
2018/10/31 macroInFocusGWConc() renamed macroutilsFocusGWConc()
macroutilsFocusGWConc() now outputs a list of data.frame. The new output format is documented.
macroutilsFocusGWConc() now has an agrument "massunits" to account for the fact that MACRO results may be produced with different mass units (argument MASSUNITS in MACRO).
In all relevant functions (macroReadBin; macroWriteBin; macroConvertBin; macroViewBin), the argument "file" has been renamed "f" to avoid clashes with the function file().
2018/08/27 Clone of the macroutils package created, with the name macroutils2. The aim of macroutils2 is to make the source code stand in a single R-file that can be loaded with one call to source(). This is necessary for enabling development and debugging on computers that do not include the R-infrastructure for package development.
2018/09/04 macroReadBin now reads MACRO intermediate-files for metabolites.
macroReadBin now sets automatically the number of years on which average concentrations are calculated (for annual, biennial or triennial application frequencies).
2018/09/11 A more generic and customisable method for reading bib-files headers (column names) has been implemented. The method is not 100 percent perfect, but generic, and it is possible to not perform any header cleaning, or to trim the column names to a fixed number of characters (known before hand).
The example bin-files have been replaced by non-copyrighted ones (MACRO In FOCUS input and output) in order to avoid problems with the new licence terms (MIT).
2018/09/14 The output of macroInFocusGWConc() has been clarified and now only exports concentrations calculated with one method (FOCUS or R percentile, default to FOCUS).
The default tests (in the folder tests/) have been updated and improved.
2018/09/18 The function macroutilsInfo() was removed from the package.
2017/10/02 Compile for R 3.3.2
Implement a new function, macroInFocusGWConc2(). It is a variante of macroInFocusGWConc() that can account for pesticide application every 1, 2, 3, ... year, and calculation of yearly, biennial, triennial, ... average-concentrations. Does not replace the calculation performed by the official FOCUS-tools.
2015/12/08 macroBugFixCleanDb() now issues a warning message if not run in R 32 bit (i386), as RODBC for MS Access works (only?) with R 32 bit.
macroBugFixCleanDb() now also attempts to fix a
bug that appear when increasing (changing) the
number of numerical layers. It seems some values
in the parameter table OutputLayers (new numerical
layers) have their column Selected empty, instead
of 0 or 1. The bug fix will also attempt to fix
value in OutputLayers that are present despite
the parameter in Output() having selected set
to 0.
2015/10/09 Implemented more strict tests / benchmarks between macroReadBin() and bin-file conversion performed by MACRO 5.2. Should be able to detect unwanted accidental changes in macroReadBin() (at least in terms of numerical accuracy)
Also included a simple benchmark in macroInFocusGWConc() on concentration and percolation.
CHANGE SIN VERSION 1.8.4
2015/09/23 Added an 'overwrite' agument to macroConvertBin(), and fixed a bug that caused an interactive question to be asked to the user even when 'gui' was FALSE and the output files already existed. Now if 'overwrite' is FALSE and 'gui' is TRUE a question is asked to the user, and otherwise if 'gui' is FALSE and 'overwrite' is FALSE, an error is issued when files already exists.
A sub-section was added in the vignette that describes how to perform a batch conversion of files with macroConvertBin(), including listing all the bin files in a folder.
2015/04/17 Compiled for R 3.2.0 RC (2015-04-15 r68178).
Cleaned-up internal call to library() or require() and use :: instead (+ Depends or Suggests or Import fields in package DESCRIPTION)
2015/05/04 Compiled for R 3.2.0 Official release.
2015/03/17 From now on macroutils will contain only "official" MACRO routines and utilities, and the routines related to crop growth (under development) have been moved to another R package, macrocrop (not publicly released).
macroutils was split for SVN version "18:50M" (macroutils version 1.7.4).
2014/07/03 Added the function macroutilsInfo() that fetches and return a rather comprehensive report on system info and package(s) version(s) and MD5, either for macroutils or for any other package
SVN revision is now displayed when the package is attached
2014/05/26 Now macroLAI() can handle a data.frame of crop parameters (multiple crops).
Parameter "Date" in macroLAI() renamed 'x'
macroIntercept() parameters now simplified
2014/05/22 fixed a bug in macroLAI() and macroRootDepth() and macroRootDensity(): parameters iharv and laiharv renamed iharv and laihar (now correct)
bug fix: macroPlot() was not always identifying correctly when given a list of data.frame to plot
Output(). Might be deleted when
the bug has been fixed in MACRO GUI.2014/03/19
macroReadBin() now output macroTimeSeries or macroTimeSeriesList objects (class), instead of macroData and macroDataList
Some functions made S3 generic and S3 methods, to favour future extensions.
macroPlot() created, generic and method function to plot macroTimeSeries and macroTimeSeriesList, as well as bin files (with GUI). Superseeds macroPlotBin()
A bug was fixed in macroPlot() background grid, which were not displayed at the right place on the X-axis, because of the POSIXct time format (incompatible with grid()).
macroPlot() now uses a ggplot2-style for axes, grid and background color.
macroPlot() now uses hcl() to generate default variable colors (it looks nicer)
2013/04/22
The package was renamed from "soilmacroutils" to "macroutils"
The internal documentation was migrated to Roxygen2
SMU.readBin() renamed to macroReadBin() .SMU.readBin() renamed to .macroReadBin() (internal) SMU.writeBin() renamed to macroWriteBin() SMU.plot() renamed to macroPlotBin() SMU.aggregate() renamed to macroAggregateBin() SMU.convert() renamed to macroConvertBin() SMU.view() renamed to macroViewBin() smuPar() renamed to muPar() getSmuPar() renamed to getMuPar()
2012/11/16 Improved legend for single plots in SMU.plot().
Fixed a bug when plotting just one variable after a multi-variable plot.
2012/11/16 New option system, smuPar() and getSmuPar() SMU.readBin() now has much less arguments.
SMU.plot() now has a "menu" to change the variables plotted, the plot style, or to zoom in and out.
The file chooser in the GUI now remembers the last location.
2012/11/15 Corrected a bug in SMU.plot() occuring when only one variable was selected
Added SMU.convert() to convert binary files into CSV text files
Added SMU.view() to view the content of binary files in a user friendly way.
2012/11/14 SMU.readBin() and SMU.plot() now have a complete GUI (simple, but portable).
SMU.plot() have been changed heavily, and does not rely any more on 'ggplot2'.
SMU.rmRunID() becomes .SMU.rmRunID() (hidden)
2010/09/08 Version 1.0 of the package. Documented.
2010/10/28 New read and write bin functions by Christian Persson.
2010/10/28 Examples bin with the bin file from the Soil program.
2011/04/14 Added SMU.aggregate(), to aggregate simulation results by hours or month, etc.
2011/05/12 Fixed a bug with ggplot2 and SMU.plot() for long time series (Date format needed)
2011/10/19 Added a "header" argument to SMU.readBin and SMU.writeBin so weather files without header can be read.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.