Skip to content

Commit

Permalink
Update to comply with CRAN requirements
Browse files Browse the repository at this point in the history
+ Minor formatting and language updates to DESCRIPTION
+ Explicitly stating no return value for print* and summary* functions
+ Update URLs that were redirects
+ Use https over http
  • Loading branch information
jcoliver committed Aug 19, 2022
1 parent c1084d9 commit de8a500
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 33 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Package: lifeR
Type: Package
Title: Identify Sites for Your Bird List
Version: 0.9.5
Version: 0.9.6
Author: Jeffrey C. Oliver
Maintainer: Jeffrey C. Oliver <[email protected]>
Description: A suite of tools to use the eBird database
Description: A suite of tools to use the 'eBird' database
(<https://ebird.org/home/>) and APIs to compare users' species lists to
recent observations and create a report of the top sites to visit to see
new species.
Expand Down
20 changes: 9 additions & 11 deletions R/MapSites.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' localities <- data.frame(locName = c("Sweetwater Wetlands", "Reid Park"),
#' locID = c("L208918", "L227274"), num_new = c(3, 5),
#' lat = c(32.279, 32.210), lng = c(-111.022, -110.924))
#' lifeR:::MapSites(sites = localities)
#' lifeR::MapSites(sites = localities)
#' }
#'
#' @import ggplot2
Expand Down Expand Up @@ -169,18 +169,16 @@ MapSites <- function(sites, center_lng = NULL, center_lat = NULL) {
#' with any invalid values (i.e. a latitude > 90) corrected to their closest
#' valid value
#'
#' @examples
#' \dontrun{
#' # Vector of decimal degrees
#' vals <- c(78, 93, -112, 184)
#' # Vector indicating latitude or longitude
#' dirs <- c(TRUE, TRUE, FALSE, FALSE)
#' lifeR:::CoordInBounds(x = vals, latitude = dirs)
#' # [1] 78 90 -112 180
#' }
#'
#' @keywords internal
CoordInBounds <- function(x, latitude) {
# Example usage
# # Vector of decimal degrees
# vals <- c(78, 93, -112, 184)
# # Vector indicating latitude or longitude
# dirs <- c(TRUE, TRUE, FALSE, FALSE)
# CoordInBounds(x = vals, latitude = dirs)
# # [1] 78 90 -112 180

# Start by fixing any outside of -180 to 180 (which takes care of longitudes)
x[x < -180] <- -180
x[x > 180] <- 180
Expand Down
3 changes: 3 additions & 0 deletions R/print.recent_obs.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#' @export
#'
#' @keywords internal
#'
#' @return No return value, called to print summary of a \code{recent_obs}
#' object
print.recent_obs <- function(x, ...) {
cat("Results of eBird query:\n", sep = "")
for (i in 1:length(x$query_params)) {
Expand Down
3 changes: 3 additions & 0 deletions R/summary.recent_obs.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#' @export
#'
#' @keywords internal
#'
#' @return No return value, called to print summary of a \code{recent_obs}
#' object
summary.recent_obs <- function(object, ...) {
print(object)
if (object$query_type == "nearby observations" & !is.null(object$obs)) {
Expand Down
12 changes: 4 additions & 8 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
## Resubmission
This is a resubmission. In this version I have:

* Converted the DESCRIPTION title to title case.
* Updated reference to eBird API in DESCRIPTION to be in single quotes, 'eBird'

* Revised DESCRIPTION description to not start with package name
* Added return value to print.recent_obs and summary.recent_obs functions

* Included only CRAN BSD 2-clause LICENSE template
* Replaced `:::` with `::` in MapSites function example

* Updated URLs that were redirects

* Consistently use https instead of http

* Consistently use trailing slashes in URLs
* Removed example from unexported function CoordInBounds

# R CMD check results

Expand Down
11 changes: 0 additions & 11 deletions man/CoordInBounds.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/MapSites.Rd

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

4 changes: 4 additions & 0 deletions man/print.recent_obs.Rd

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

4 changes: 4 additions & 0 deletions man/summary.recent_obs.Rd

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

0 comments on commit de8a500

Please sign in to comment.