- Since R verson 3.6.0, staged install is the default way. Using hard coded paths outside local variables in functions will not work with staged install. Previously, .options env was used to store tutorial data related file pahts. In this release, an environmental variable (env) is not used anymore. Instead, a regular list is returned by a function. Hence, staged install is once again possible.
- Travis CI setup has been fixed and moved to a more recent Ubuntu version (xenial).
- Function
set_tutorialdir()
has been removed as it is not used anywhere within the package and the usefulness is limited.
- R CMD check was failing because of more stringent test for multiple logical
values in more recent versions of R.
testthat
was happily passing the tests, but checks failed. This has now been fixed.
- Opt-out from staged install which is going to be the default in R 3.6.0.
zonator
does not behave well with staged install because of some of the hardcoded paths in the package. Disabling staged install is a stopgap measure and ideally the path definition should be handled more gracefully.
- Update all tests to use
testthat
2.0.
check_zonation()
was failing on Solaris. This patch-release tries to fix that issue by usingSys.which()
as suggested by BDR, but it cannot be tested before submitting to CRAN.- Remove startup notice, which claims that the package depends on package
zdat
. This is not true.
zdat
package needed for development and building the vignettes is now installed from Github usingdrat
. Accordingly, various checks are done to condition some code to run only ifzdat
is installed.- Vignette image dimensions updated.
- Submitted to CRAN
zonator
website now generated usingpkgdown
- New method
cost()
can be used to extract cost data from results. Implemented forZresults
andZvariant
. - New utility function
file_path_relative_to()
can be used to dynamically construct relative paths for spp data. - New method
copy_zvariant()
can be used to create a copy of an existing variant with a new name.
- Tutorial data removed from
zonator
and placed to a separate data packagezdat
. This package is required for developingzonator
.
XXX.features_info.txt
is now parsed intoZresults
objects. This way, e.g. species distribution sum information becomes readilly available.
- Variant names in the tutorial distributed with
zonator
in dirinst/extdata/tutorial
have been truncated to avoid unportable long paths strings. - Bunch of warnings generated by implicit S4 embedding and some tests have been suppressed.
- All WARNINGs and NOTEs (except one related to the size of the data installation) gone.
- Variant weights can now be easily set using
sppweights()<-
.
- Define the color scheme for
plot_curves()
dynamically between ColorBrewer'sSet1
andSet2
. Where the former has better colors, the latter has more. create_spp()
accepts new argumentrecursive = TRUE
which will look for rasters in target directory recursively.- The
spp_file_dir
forcreate_spp()
accepsts multiple directories (in vector) instead of just one. - New utility
decimalplaces()
can figure out how many decimal places a number has. save_zvariant()
now dynamically decides how to formatweight
andalpha
column values based onmax(decimalplaces(x))
in the vector.create_zproject()
now actually checkst if template dat-file exists.
- Fix default regex pattern for
spp_file_pattern
increate_spp()
. Previous version did find .tif and .img file, but also some directories.
- Previously all keys had to be present in current group codes when using
groupnames()<-
. This doesn't make much sense, so now there can be extra groups in the value being assigned as long as as all group codes are found in the keys.
- Always update groupnames in zvariant@results@grp.curves. Fixes issue #54.
- Beacause of the precvious, make
regroup_curves()
always return aZGroupCurvesDataFrame
object.
leaf_tags()
is a new utility function that can get leaf (outermost) tags and their values in a nested list (used for dat-parsing).get_dat_param()
can be used to get values of a (valid) Zonation run configuration parameter (i.e. the content of a dat-file) from aZvariant
object.set_dat_param()
can be used to set values of a (valid) Zonation run configuration parameter (i.e. the content of a dat-file) for aZvariant
object.zparameters()
is used to fetch all accepted Zonation run configuration parameters (i.e. parameters in the dat file). Can return just the parameter names or a list of[[parameter_name]][[section]]
".show()
forZvariant
now prints run configuration parameters as well.set_dat_param()
can be used to set run configuration parameters (i.e. dat file parameters). Only valid parameters are accepted.get_dat_param()
can be used to get run configuration parameters (i.e. dat file parameters).sppdata()<-
allows spp data to be modified. This is mostly needed in creating/cpoying variants as editing spp data in place is not probably a good idea.save_zvarint()
saves the current state of aZvariant
object on the file system. Saving can overwrite exisiting configuration files or create new.create_zproject()
now stops ifspp_template_dir
doesn't exist.- Re-implementation of
tools::file_path_sans_ext()
that can handle periods (".") just before file extension.
- Assigning groups to a
Zvariant
object when no groups were used initially failed before (see issue #45.), fixed now.
read_ini()
renamed toread_dat()
.create_zproject()
no longer uses "do_" prefix when generating bat files.- Run parameters from dat-files are now parsed as-is. Previously parameter names were cleaned up (e.g. " " and "-" removed), but this made writing dat files with correct parameter names really hard.
- Much has been changed in the way tutorial data paths are handled internally. At some point, the whole tutorial data set will be moved to a package of its own.
- Removed
plyr
from the dependencies. - Make depdendcy to
ggplot2
>= 2.0.0. This wayaes_()
can be used and CHECK doesn't complain about "undefined global variables" anymore.
- Fix issue #43.
create_zproject()
functionality has been split into two.create_zproject()
now handles the creation of a completely new Zonation project (also on the file system) whereasload_zproject()
can be used to load existing Zonation projects. This change creates a cleaner and more intuitice API. NOTE The API forcreate_zproject()
has changed, so check your code.- Vignettes have been much improved. There is now a conceptual intro to
Zonatio project-variant-results typology as well as how this typology
maps into
zonator
classes.
dir.exists()
replaced withfile.exists()
in spp-creation.
plot_curves()
accepts new argumentfix.y
which can be used to fix the y-axis to [0, 1]. Useful e.g. plotting runs with condition layers.modified
slot of azresults
object is now parsed from the run info file. Not ideal, but couldn't figure out a way how to do this reliably on Linux.print()
andshow()
methods are now implemented for objects of classZvariant
. Makes printing basic data a bit easier.
- Result raster pattern matching got confused e.g. by auxiliary files created by QGIS. Regexp used to match result raster files (img/tif/asc) now better.
- New color scheme
RdYlBu
added. This ColorBrewer's 7-level RdYlBu palette. - New function
create_spp()
can be used to create spp files based on a directory of input raster files. create_zproject()
now works by giving it a directory containing input rasters based on which the spp files are created.
- Update package vignettes.
- New tests and checks for
read_ini()
. - New color scheme
BrBG
added. This a slight variation from ColorBrewer's 7-level BrBG scheme with the lowest value replaced with grey.
-
Fix imports in roxygen2 docs
-
Generic group names assigned at initiation. If Zvariant object has groups enabled, assign generic group names "group1", "group2" to groups automatically.
-
Generic group ID larger than 10 would not get mapped right because of a sloppy gsub-replacement. Regex fixed and
groupnames()<-
should work correctly when one has more than 10 groups. -
get_variant()
forZproject
objects now checks the input index properly (issue34) -
Trying to get rank rasters from a set of variants with no rank rasters available caused and error, now produces warnings and returns a NA.
- New function
ds_alpha()
that can be used to calculate alpha value for distribution smoothing.
- Rename
weights
tosppweights
so that it doesn't overwrite base generic.
-
Assigning group names now works correctly with generic default values and whenever groups (ids) are changed. (
issue29) -
Generic group naming now works, i.e. if group ids are changed group names get a generic value "group1", "group2" etc. (
issue22)
-
Assigning group ids with
groups()<-
now recalculates group specific stats (min, mean, max, weighted mean) for defined groups. In other words, it is now possible to define groups other than those defined in Zonation groups file and have the group curves data calculated for the new groups. -
cross_jaccard()
now returns a dataframe with correct RasterLayer names colnames and rownames. -
cross_jaccard()
now accpets a numeric vector of threshold values for comparison. -
jaccard()
now has additional parameters for controlling the thresholds for rastersx
andy
being compared. Argumentsxmin
,xmax
,ymin
, andymax
can be used to control which ranges of the raster values are compared. -
New methods for class
Zproject
:- Method
rank_rasters()
accepts a new argumentvariants
which can be either a character of numeric vector of variant names / IDs defining which rank rasters are included in the RasterStack that is returned. Default is to return all.
- Method
-
New methods for class
Zvariant
:- Methods
weights()
returns a numeric vector of weights assigned to a variant.
- Methods
-
Creating new Zproject object based on an existing Zonation project involves reading in a lot of files and it can be useful to know the sequence of reading in case something goes wront.
create_zproject()
now accepts a new argumentdebug=TRUE
which enables logging of file reading sequence. (issue28) -
New methods for class
Zvariant
:- Generic replacement method
groups()<-
- Method
nfeatures()
returns the number of features in a variant
- Generic replacement method
- Fix bugs in tests
check_zonation()
fixed on Windows (issue26)
- New methods for class
ZCurvesDataFrame
:featurenames()
- Fix initial feature naming (
issue24) check_path()
works on Windows (issue23)- Fix several tests on Windows
-
Results vignette has bee updated.
-
Post-processign (PPA) LSM results are now handled by
Zresults
. Results, if present, are read in from the output folder. More specifically:- Class
Zresults
now defines a new slotppa.lsm
tha holds the content of PPA LSM results
- Class
-
zlegend()
can be used to fetch Zonation rank raster map legend schemes. So far only one scheme ("spectral") is implemented. -
New methods for class
Zproject
:rank_rasters()
: returns aRasterStack
of all priority rank rasters of all variants within a project
-
New methods for class
Zvariant
:- Implented
curves()
- Implented
-
New methods for class
Zvariant
andZresults
:rank_raster()
: returnsRasterLayer
of priority rank raster of a given variant or its results
-
New methods for class
Zproject
:variants()
: returns a list containing all the variants within a project
-
New methods for class
Zvariant
andZresults
:outdir()
: returns the path to location of output dirctory
Maintance update, R CMD check and TravisCI test passes after few minor fixes.
- Class
Zcurves
has been refactored to 2 classes:ZCurvesDataFrame
andZGroupCurvesDataFrame
. Change was introduced mostly to handle performance curves plotting more sensibly.
-
Generic
groupnames()
now returns a character vector instead of a named character vector (with names being the original group numbers) -
plot()
now works forZCurvesDataFrame
andZGroupCurvesDataFrame
objecs. -
New methods for class
Zresults
:groupnames()
- RColorBrewer
-
bat-files are read recursively when creating a project (
issue20) -
check_paths()
now deals with relative path components -
has_results()
now returns a list of logicals instead of a single logical -
New methods for class
Zresults
:has_results()
: returns a list of TRUE/FALSE depending on whether the particular results items (curves, grp.curves, rank, wrscr, prop) are available or not
- Much of the internal functionality has been re-written
- Documentation is improving, but still needs a lot of work
-
New classes
Zresults
andZcurves
. See docs for methods and structure. -
New methods for class
Zvariant
:groupnames()<-
: assign human readable group namesgroupnames()
: get assigned unique groupnames and codeshas_results()
: returns TRUE/FALSE depending on whether the variant has results or notresults()
: returns aZresults
object specific to aZvariant
object
- Feature can be named for each variant and feature and group identities can be joined and queried.
- New methods for class
Zvariant
:featurenames()<-
: assign human readable feature namesfeaturenames()
: get assigned unique featurenamessppdata()
: return the whole spp data frame of a variant
- Add groups functionality to
Zvariant
. Groups are read in from the actual Zonation input file and can be used (eventually) in many operations.
-
New methods for class
Zvariant
:groups()
: returns a numeric vector containing group codes for featuresgroupnames()<-
: assign human readable group names to groupsgroupnames()
: get assigned unique groupnames with associated group codes
-
New utlity functions:
read_groups()
: read in Zonation groups file
- Refactor all function names to follow underscore "_" pattern. Assume all old calls broken.
- Updated the tutorial data shipping with zonator to correspond with the updated Zonation tutorial (basic)
- Started using knit/Rmd to create vignettes
- Started NEWS document
-
New methods for class
Zpoject
:names()
: returns a character vector of the names of variants in a project
-
New methods for class
Zvariant
:has_results()
: boolean indicating whether the variant already has associated results
-
New utlity functions:
read.spp()
: read in spp files