Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-hurst committed Sep 5, 2021
1 parent 7e65e2c commit 4e10d04
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 26 deletions.
31 changes: 20 additions & 11 deletions R/tissot.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#' This function generates Tissot's indicatrix
#'
#' This function returns equally-sized circles (radius = 300km) as sf-polygons
#' to use as Tissot's indicatrix. The circles are located on a regular grid in
#' lon/lat every 20 degrees.
#' @return circles as objects of class sf
#' This function generates Tissot's indicatrix.
#' It generates equally-sized circles over then entire extent of the input geometry.
#' These circles can be used to visualize distrotion of a map projection.
#' @return object (a list) of class tissot
#' @import sf
#' @param geom input geometry for which tissot should be generated
#' @param circles_den Specifies the number of indicatrix circles that are generated.
Expand Down Expand Up @@ -43,17 +43,21 @@ tissot <- function (geom, circles_den=c(-1), circle_size = "auto") {
value
}

#' This function returns the original geometries, from which Tissot indicatrix
#' was generated
#' @return Original geometry as objects of class sf
#' Get base geometries
#'
#' This function returns the geometries, from which Tissot indicatrix
#' was generated in the first place.
#' @return Geometry as objects of class sf
#' @param obj tissot object
#' @export
#' @name get_geometry
get_geometry <- function(obj){
return(sf::st_transform(obj$geometry, obj$crs))
}

#' This function returns the Tissot indicatrix circles that were generated
#' Get Tissot circles
#'
#' This function returns the Tissot indicatrix circles that were generated.
#' @return Tissot indicatrix as polygon objects of class sf
#' @param obj tissot object
#' @export
Expand All @@ -62,8 +66,10 @@ get_indicatrix <- function(obj){
return(sf::st_transform(obj$circles, obj$crs))
}


#' This function plots the sf geometry and Tissot indicatrix circles that were generated
#' Plot indicatrix
#'
#' This function plots the sf geometry and Tissot indicatrix circles that were generated.
#' ggplot2 library required.
#' @param x tissot object
#' @param ... ignored
#' @param crs target coordinate reference system: object of class 'crs', or input string for st_crs,
Expand Down Expand Up @@ -102,6 +108,8 @@ plot.tissot <- function(x, ..., crs="auto", areachange = FALSE){

}

#'Print indicatrix
#'
#' This function prints Tissot indicatrix circles that were generated
#' @param x tissot object
#' @param ... ignored
Expand All @@ -112,7 +120,8 @@ print.tissot <- function(x, ...){
print(x$circles)
}


#'Summarize indicatrix
#'
#' This function summarizes Tissot indicatrix circles details
#' @param object tissot object
#' @param ... ignored
Expand Down
9 changes: 4 additions & 5 deletions man/get_geometry.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/get_indicatrix.Rd

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

5 changes: 3 additions & 2 deletions man/plot.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/print.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/summary.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/tissot.Rd

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

0 comments on commit 4e10d04

Please sign in to comment.