Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit c3fedf9

Browse files
author
obrl_soil
committed
v1.0.0
see NEWS
1 parent a611dfc commit c3fedf9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1552
-676
lines changed

DESCRIPTION

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
Package: dsmartr
22
Type: Package
33
Title: dsmartr: An R implementation of the DSMART algorithm
4-
Version: 0.0.0.9013
5-
Date: 2017-08-24
4+
Version: 1.0.0
5+
Date: 2018-01-09
66
Authors@R: c(
7-
person("Lauren", "O'Brien", email = "obrl_soil@gmail.com", role = c('aut', 'cre')),
8-
person("Nathan", "Odgers", email = "nathan.odgers@sydney.edu.au", role = 'aut'),
9-
person("Brendan", "Malone", email = "brendan.malone@sydney.edu.au", role = 'aut'))
7+
person("Lauren", "O'Brien", email = "obrlsoilau@gmail.com", role = c('aut', 'cre')),
8+
person("Nathan", "Odgers", email = "nathan.odgers@sydney.edu.au", role = 'ctb'),
9+
person("Brendan", "Malone", email = "brendan.malone@sydney.edu.au", role = 'ctb'))
1010
Description: This package reinterprets legacy soil mapping by correlating existing map information with higher-density environmental data.
1111
URL: https://github.com/obrl-soil/dsmartr
1212
BugReports: https://github.com/obrl-soil/dsmartr/issues
13-
Depends: R (>= 3.3.0)
13+
Depends: R (>= 3.3.0),
14+
raster,
15+
sp,
16+
sf
1417
Imports:
1518
C50,
1619
bindrcpp,
@@ -19,12 +22,10 @@ Imports:
1922
magrittr,
2023
methods,
2124
purrr,
22-
raster,
2325
rgdal,
26+
rgeos,
2427
rlang,
25-
sf (>= 0.5),
2628
snow,
27-
sp,
2829
stats,
2930
tidyr,
3031
units,

NAMESPACE

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(dsmartr_check_polygons)
4-
export(dsmartr_class_maps)
5-
export(dsmartr_collate)
6-
export(dsmartr_eval_npred)
7-
export(dsmartr_eval_nxpred)
8-
export(dsmartr_eval_pgap)
9-
export(dsmartr_eval_ties)
10-
export(dsmartr_iterate)
11-
export(dsmartr_most_likely)
12-
export(dsmartr_pred_masks)
13-
export(dsmartr_prep_points)
14-
export(dsmartr_prep_polygons)
3+
export(check_attributes)
4+
export(class_maps)
5+
export(collate)
6+
export(eval_npred)
7+
export(eval_pgap)
8+
export(eval_ties)
9+
export(in_range)
10+
export(iterate)
11+
export(most_likely)
12+
export(prediction_masks)
13+
export(prep_points)
14+
export(prep_polygons)
15+
export(strict_cfp)
1516
importFrom(C50,C5.0)
1617
importFrom(dplyr,distinct)
1718
importFrom(dplyr,filter)
@@ -23,31 +24,42 @@ importFrom(methods,is)
2324
importFrom(purrr,map)
2425
importFrom(purrr,map2_lgl)
2526
importFrom(purrr,map_int)
27+
importFrom(raster,alignExtent)
2628
importFrom(raster,beginCluster)
2729
importFrom(raster,calc)
2830
importFrom(raster,cellFromPolygon)
2931
importFrom(raster,cellFromXY)
3032
importFrom(raster,clusterR)
33+
importFrom(raster,crop)
3134
importFrom(raster,crs)
3235
importFrom(raster,endCluster)
36+
importFrom(raster,extent)
3337
importFrom(raster,extract)
3438
importFrom(raster,getCluster)
3539
importFrom(raster,inMemory)
40+
importFrom(raster,intersect)
41+
importFrom(raster,ncell)
3642
importFrom(raster,nlayers)
43+
importFrom(raster,raster)
44+
importFrom(raster,rasterToPoints)
3745
importFrom(raster,ratify)
3846
importFrom(raster,readAll)
3947
importFrom(raster,stack)
4048
importFrom(raster,unstack)
4149
importFrom(raster,writeRaster)
4250
importFrom(raster,xyFromCell)
51+
importFrom(rgeos,gIntersection)
52+
importFrom(rgeos,gIntersects)
53+
importFrom(rgeos,gUnaryUnion)
4354
importFrom(sf,st_area)
4455
importFrom(sf,st_as_sf)
56+
importFrom(sf,st_geometry)
4557
importFrom(sf,st_point)
4658
importFrom(sf,st_set_crs)
4759
importFrom(sf,st_set_geometry)
4860
importFrom(sf,st_sfc)
4961
importFrom(sf,st_transform)
50-
importFrom(sf,write_sf)
62+
importFrom(sf,st_write)
5163
importFrom(sp,spTransform)
5264
importFrom(stats,complete.cases)
5365
importFrom(stats,na.omit)

NEWS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
## v.1.0.0 'what I did on my holidays'
2+
* Happy New Year, have an API change. Took 'dsmartr_' out of all function names because Twitter Said
3+
* Added @importFroms to data.R so sf/sp/raster don't need to be libraried
4+
* switched to custom function 'strict_cfp' for returning cell numbers that intersect polygons - better performance, plus old way has some obscure bugs with particular geometries
5+
* Covariate samples now write to GPKG as slow write issue has been resolved (see sf issue #470)
6+
* all internal functions separated from wrappers, enabling unit testing
7+
* Core functions all have unit tests
8+
* prediction_masks function corrected
9+
* eval_npred and eval_nxpred functions combined
10+
* Documentation updated
11+
* Regenerated demo data with some tidying up, particularly soil map geometry
12+
113
## v.0.0.0.9013
214

315
* simplified and debugged `dsmartr_class_maps`

R/data.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
#' A dataset containing an extract of 1:100,000 scale soils mapping from the Whitsunday coast area.
7070
#' The complete dataset can be viewed in the \href{https://qldglobe.information.qld.gov.au/}{Queensland
7171
#' Globe.} Data was extracted from the Queensland Soil and Land Information (SALI) database in 2017
72-
#' and formatted for dsmartr in R 3.3.
73-
#' @format A tbl/sf dataframe of mixed POLYGON/MULTIPOLYGON types in EPSG:3577, with 100 rows
72+
#' and formatted for dsmartr in R 3.4.2.
73+
#' @format An sf data.frame of POLYGON type in EPSG:3577, with 105 rows
7474
#' and 10 variables:
7575
#' \describe{
7676
#' \item{PROJECT_CODE}{Three-letter code identifying the soil survey}
@@ -82,18 +82,19 @@
8282
#' \item{PERC_1}{Estimated percentage of the map unit occupied by CLASS_1}
8383
#' \item{PERC_2}{Estimated percentage of the map unit occupied by CLASS_2}
8484
#' \item{PERC_3}{Estimated percentage of the map unit occupied by CLASS_3}
85-
#' \item{geom}{list-column with class 'sfc_GEOMETRY', 'sfc'}}
85+
#' \item{geom}{list-column with class 'sfc_POLYGON', 'sfc'}}
8686
#' @source \itemize{
8787
#' \item{\url{https://publications.qld.gov.au/dataset/soils-whitsunday-coast-wcs}}
8888
#' \item{\url{https://www.qld.gov.au/environment/land/soil/soil-data/survey-types/}}}
89+
#' @note This object's geometry has its precision attribute set to one decimal place (approx 10cm on the ground).
8990
'heronvale_soilmap'
9091

9192
#' Data: Decoded soil class names
9293
#'
9394
#' A table of soil class labels found in 'heronvale_soilmap' and 'heronvale_known_sites', along with
9495
#' their full names. Explanations of the concept associated with each soil name are available in the
9596
#' report associated with this mapping project.
96-
#' @format A tibble with 38 rows and 2 columns:
97+
#' @format A data.frame with 37 rows and 2 columns:
9798
#' \describe{
9899
#' \item{CLASS}{Soil class label}
99100
#' \item{NAME}{Soil class name}}

R/dsmartr.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
#' dsmartr is an approach to the DSMART model (Odgers, 2014), which attempts increase the
44
#' level of detail in legacy soil maps. Relationships between these maps and various environmental
55
#' datasets are used to build a classification tree model. The model is used to map the map
6-
#' components as a fine-scaled raster. This process is repeated multiple times, with variation introduced around sample location and
7-
#' soil class proportions to vary the outputs somewhat. The model realisations are then processed
8-
#' to give a 'most likely' soils map. Refer to the package vignette for more detail.
6+
#' components as a fine-scaled raster. This process is repeated multiple times, with variation
7+
#' introduced around sample location and soil class proportions to vary the outputs somewhat. The
8+
#' model realisations are then processed to give a 'most likely' soils map. Refer to the package
9+
#' vignette for more detail.
910
#'
1011
#' @references Odgers, N.P., Sun, W., McBratney, A.B., Minasny, B., Clifford, D., (2014)
1112
#' \href{http://dx.doi.org/10.1016/j.geoderma.2013.09.024}{Disaggregating and harmonising soil map
1213
#' units through resampled classification trees}. Geoderma, 214-215: 91-100.
13-
#'
1414
"_PACKAGE"
15+
16+
utils::globalVariables(names = c("CELL"), package = 'dsmartr')

0 commit comments

Comments
 (0)