Skip to content

Commit

Permalink
prepare CRAN submission 5
Browse files Browse the repository at this point in the history
  • Loading branch information
MiKatt committed Aug 9, 2017
1 parent 3b80168 commit c6bbbc5
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 51 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Package: openSTARS
Type: Package
Title: An Open Source Implementation of the ArcGIS Toolbox STARS
Description: An open source implementation of the STARS toolbox
(Peterson & Ver Hoef, 2014)) using R and GRASS GIS.
It prepares the *.ssn object needed for the SSN package.
Title: An Open Source Implementation of the 'ArcGIS' Toolbox 'STARS'
Description: An open source implementation of the 'STARS' toolbox
(Peterson & Ver Hoef, 2014, doi:10.18637/jss.v056.i02)) using 'R' and 'GRASS GIS'.
It prepares the *.ssn object needed for the 'SSN' package.
A digital elevation model (DEM) is used to derive stream networks
(in contrast to STARS that can clean an existing stream network).
(in contrast to 'STARS' that can clean an existing stream network).
Version: 1.0.0
Authors@R: c(person("Mira", "Kattwinkel", role = c("aut","cre"),
email = "mira.kattwinkel@gmx.net"),
Expand Down
2 changes: 1 addition & 1 deletion R/calc_edges.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#'
#'@return Nothing. The function produces the following map: \itemize{
#' \item{'edges'} {derived stream segments with computed attributes needed for
#' SSN (vector)} }
#' 'SSN' (vector)} }
#'
#'@note \code{\link{setup_grass_environment}}, \code{\link{import_data}} and
#' \code{\link{derive_streams}} must be run before.
Expand Down
4 changes: 2 additions & 2 deletions R/calc_prediction_sites.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#'Calculate prediction sites for SSN object.
#'Calculate prediction sites for 'SSN' object.
#'
#'@description A vector (points) map of prediction sites is created and several
#'attributes are assigned.
Expand All @@ -16,7 +16,7 @@
#'smaller than \code{nsites}.
#'
#'Steps include: \itemize{ \item{Place points on edges with given distance form
#'each other} \item{Assign unique identifiers (needed by the SSN package) 'pid'
#'each other} \item{Assign unique identifiers (needed by the 'SSN' package) 'pid'
#'and 'locID'.} \item{Get 'rid' and 'netID' of the stream segment the site
#'intersects with (from map 'edges').} \item{Calculate upstream distance for
#'each point ('upDist').} \item{Calculate distance ratio ('distRatio') between
Expand Down
4 changes: 2 additions & 2 deletions R/check_ssn.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Checking SSN object.
#' Checking 'SSN' object.
#'
#' This function roughly checks the SSN object. It returns FALSE if some
#' This function roughly checks the 'SSN' object. It returns FALSE if some
#' essential columns are missing or values have illegal values.
#'
#' @importFrom rgdal readOGR
Expand Down
2 changes: 1 addition & 1 deletion R/correct_compl_junctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' vertexmove). So far, this function works only for junctions with three
#' inflows, not more.
#'
#' @param clean logical; should intermediate files be removed from GRASS
#' @param clean logical; should intermediate files be removed from 'GRASS'
#' session?
#' @param celltoldig integer; number of digits the cell size dimensions are
#' rounded to before it is checked whether they are identical
Expand Down
2 changes: 1 addition & 1 deletion R/derive_streams.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @param dem_name character vector, optional; default: 'dem'; useful if
#' conditioned and / or burnt in DEM raster from previous runs shall be used.
#' @param clean logical; should intermediate raster layer of imported streams
#' ('streams_or') be removed from GRASS session?
#' ('streams_or') be removed from 'GRASS' session?
#' @param mem logical; should -m flag in GRASS r.watershed be used (as indicated in its help)
#' see also \code{\link{watershed_memory}}-function
#'
Expand Down
6 changes: 3 additions & 3 deletions R/export_ssn.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Export .ssn object
#' Export 'SSN' object
#'
#' This function exports the calculated sites, edges and binary IDs
#' to a folder which then can be read using the SSN package.
#' to a folder which then can be read using the 'SSN' package.
#'
#' @import rgrass7
#' @importFrom utils write.table
Expand All @@ -14,7 +14,7 @@
#' @return Nothing. Files are written to the specified folder
#'
#' @details First it is checked if one of the column names is longer than 10
#' characters (which cannot be exported to ESRI shape files as required by SSN).
#' characters (which cannot be exported to ESRI shape files as required by 'SSN').
#'
#' \code{delete_directory = TRUE} is useful if the same directory name has been
#' used before and the existing data shall be overwritten.
Expand Down
12 changes: 6 additions & 6 deletions R/import_data.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Import data into GRASS.
#' Import data into 'GRASS.'
#'
#' This function loads dem and sites data (both required) into the GRASS session.
#' This function loads dem and sites data (both required) into the 'GRASS' session.
#' Optionally, prediction sites and streams data can be loaded and the streams
#' may be corrected by snapping to prevent lose ends.
#'
Expand All @@ -13,19 +13,19 @@
#' If available it can be burnt into DEM.
#' @param snap_streams boolean (optional); snap line ends.
#' If TRUE line ends of the streams are snapped to the next feature if they are
#' unconnected with threshold of 10 m using GRASS function v.clean.
#' unconnected with threshold of 10 m using 'GRASS' function v.clean.
#' @param pred_sites character vector (optional); paths to prediction sites
#' vector files
#' @param predictor_maps character vector (optional); paths to raster data to
#' import as predictors.
#' @param predictor_names character vector (optional); names for potential predictor
#' variables.
#'
#' @return Nothing, the data is loaded into the GRASS session (mapset PERMANENT).
#' @return Nothing, the data is loaded into the 'GRASS' session (mapset PERMANENT).
#' The DEM is stored as raster 'dem', sites as vector 'sites_o', prediction sites
#' vector(s) using the original file names with an appended '_o' (without extension),
#' streams as vector 'streams_o' in the GRASS location. Additionally, predictor
#' map raster(s) can be read in and are stored in GRASS using either the
#' streams as vector 'streams_o' in the 'GRASS' location. Additionally, predictor
#' map raster(s) can be read in and are stored in 'GRASS' using either the
#' original file names (without extension) or using the names provides in
#' predictor_names. The latter option may be useful if ArcGIS grid data
#' (typically stored as 'grid_name/w001001.adf') are used.
Expand Down
4 changes: 2 additions & 2 deletions R/openSTARS.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' openSTARS: An Open Source Implementation of the ArcGIS Toolbox STARS.
#' openSTARS: An Open Source Implementation of the 'ArcGIS' Toolbox 'STARS'.
#'
#' openSTARS provides functions to prepare data so that it can be imported by
#' the \code{\link[SSN]{SSN}} package for spatial modelling on stream networks.
#' GRASS GIS 7.0 (or greater) with installed addons r.stream.basins,
#' 'GRASS GIS 7.0' (or greater) with installed addons r.stream.basins,
#' r.stream.distance, r.stream.order, and r.hydrodem is needed.
#'
#' @import rgrass7
Expand Down
8 changes: 4 additions & 4 deletions R/setup_grass_environment.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' Setup GRASS environment.
#' Setup 'GRASS' environment.
#'
#' This function sets the GRASS mapset to PERMANENT and sets its projection and extension.
#' This function sets the 'GRASS' mapset to PERMANENT and sets its projection and extension.
#'
#' @param dem character; path to DEM.
#' @param sites character string or object; path to sites vector file (shape)
Expand All @@ -9,14 +9,14 @@
#' @param proj4 (optional) proj4 string; character string of projection arguments
#'
#'
#' @return Nothing, the GRASS mapset is set to PERMANENT,
#' @return Nothing, the 'GRASS' mapset is set to PERMANENT,
#' projection is set to the one of the sites shape, to the proj4 string or to
#' the epsg code provided, the extent of the region is set to the one of bounding
#' box of the dem.
#'
#' @note Either \code{sites}, \code{epsg} or \code{proj4} must be provided. Make
#' sure that all raster and vector files are in the same projection; it will be
#' overwritten without warning. A GRASS session must be initiated before, see
#' overwritten without warning. A 'GRASS' session must be initiated before, see
#' \code{\link[rgrass7]{initGRASS}}.
#'
#' @author Mira Kattwinkel, \email{mira.kattwinkel@@gmx.net}
Expand Down
12 changes: 10 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "cran-comments.md"
author: "Mira Kattwinkel"
date: "August 8, 2017"
date: "August 9, 2017"
output: html_document
---

Expand All @@ -27,4 +27,12 @@ Some examples take quite a while to run (> 5s) because they all contain the full
workflow of loading and processing GIS files to be stand-alone examples.

## Downstream dependencies
There are no downstream dependencies as this is the first release of the package.
There are no downstream dependencies as this is the first release of the package.

## Submission review comments
All comments were taken into account except one:
"Please explain the acronym DEM in your description."

This is already done in the description right before giving the acronym:
"A digital elevation model (DEM) is used to derive stream networks"

2 changes: 1 addition & 1 deletion man/calc_edges.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/calc_prediction_sites.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_ssn.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/correct_compl_junctions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/derive_streams.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/export_ssn.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions man/import_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/openSTARS.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/setup_grass_environment.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c6bbbc5

Please sign in to comment.