check_zonation()was failing on Solaris. This patch-release tries to fix that issue by using
Sys.which()as suggested by BDR, but it cannot be tested before submitting to CRAN.
zdat. This is not true.
zdatpackage needed for development and building the vignettes is now installed from Github using
drat. Accordingly, various checks are done to condition some code to run only if
zonatorwebsite now generated using
cost()can be used to extract cost data from results. Implemented for
file_path_relative_to()can be used to dynamically construct relative paths for spp data.
copy_zvariant()can be used to create a copy of an existing variant with a new name.
zonatorand placed to a separate data package
zdat. This package is required for developing
XXX.features_info.txtis now parsed into
Zresultsobjects. This way, e.g. species distribution sum information becomes readilly available.
inst/extdata/tutorialhave been truncated to avoid unportable long paths strings.
plot_curves()dynamically between ColorBrewer’s
Set2. Where the former has better colors, the latter has more.
create_spp()accepts new argument
recursive = TRUEwhich will look for rasters in target directory recursively.
create_spp()accepsts multiple directories (in vector) instead of just one.
decimalplaces()can figure out how many decimal places a number has.
save_zvariant()now dynamically decides how to format
alphacolumn values based on
max(decimalplaces(x))in the vector.
create_zproject()now actually checkst if template dat-file exists.
create_spp(). Previous version did find .tif and .img file, but also some directories.
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.
regroup_curves()always return a
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 a
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 a
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
Zvariantnow 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 a
Zvariantobject on the file system. Saving can overwrite exisiting configuration files or create new.
create_zproject()now stops if
tools::file_path_sans_ext()that can handle periods (“.”) just before file extension.
Zvariantobject when no groups were used initially failed before (see issue #45.), fixed now.
create_zproject()no longer uses “do_” prefix when generating bat files.
plyrfrom the dependencies.
ggplot2>= 2.0.0. This way
aes_()can be used and CHECK doesn’t complain about “undefined global variables” anymore.
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) whereas
load_zproject()can be used to load existing Zonation projects. This change creates a cleaner and more intuitice API. NOTE The API for
create_zproject()has changed, so check your code.
plot_curves()accepts new argument
fix.ywhich can be used to fix the y-axis to [0, 1]. Useful e.g. plotting runs with condition layers.
modifiedslot of a
zresultsobject is now parsed from the run info file. Not ideal, but couldn’t figure out a way how to do this reliably on Linux.
show()methods are now implemented for objects of class
Zvariant. Makes printing basic data a bit easier.
RdYlBuadded. This ColorBrewer’s 7-level RdYlBu palette.
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.
BrBGadded. 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.
Zproject objects now checks the input index properly (
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.
ds_alpha()that can be used to calculate alpha value for distribution smoothing.
sppweightsso that it doesn’t overwrite base generic.
Assigning group names now works correctly with generic default values and whenever groups (ids) are changed. (
Generic group naming now works, i.e. if group ids are changed group names get a generic value “group1”, “group2” etc. (
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 rasters
y being compared. Arguments
ymax can be used to control which ranges of the raster values are compared.
rank_rasters() accepts a new argument
variants 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.
weights() returns a numeric vector of weights assigned to a variant.
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 argument
debug=TRUE which enables logging of file reading sequence. (
nfeatures() returns the number of features in a variant
check_zonation()fixed on Windows (
check_path()works on Windows (
Results vignette has bee updated.
Zresults. Results, if present, are read in from the output folder. More specifically:
Zresults now defines a new slot
ppa.lsm tha holds the content of PPA LSM results
zlegend() can be used to fetch Zonation rank raster map legend schemes. So far only one scheme (“spectral”) is implemented.
rank_rasters(): returns a
RasterStack of all priority rank rasters of all variants within a project
RasterLayer of priority rank raster of a given variant or its results
variants(): returns a list containing all the variants within a project
outdir(): returns the path to location of output dirctory
Maintance update, R CMD check and TravisCI test passes after few minor fixes.
Zcurveshas been refactored to 2 classes:
ZGroupCurvesDataFrame. Change was introduced mostly to handle performance curves plotting more sensibly.
groupnames() now returns a character vector instead of a named character vector (with names being the original group numbers)
plot() now works for
check_paths()now deals with relative path components
has_results() now returns a list of logicals instead of a single logical
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
Zcurves. See docs for methods and structure.
groupnames()<-: assign human readable group names
groupnames(): get assigned unique groupnames and codes
has_results(): returns TRUE/FALSE depending on whether the variant has results or not
results(): returns a
Zresults object specific to a
featurenames()<-: assign human readable feature names
featurenames(): get assigned unique featurenames
sppdata(): return the whole spp data frame of a variant
Zvariant. Groups are read in from the actual Zonation input file and can be used (eventually) in many operations.
groups(): returns a numeric vector containing group codes for features
groupnames()<-: assign human readable group names to groups
groupnames(): get assigned unique groupnames with associated group codes
read_groups(): read in Zonation groups file
names(): returns a character vector of the names of variants in a project
has_results(): boolean indicating whether the variant already has associated results
read.spp(): read in spp files