Skip to content

Commit

Permalink
prerelease push: no errors or warnings or notes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewLJackson committed Apr 28, 2017
1 parent f29eb8d commit f039c23
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 40 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Imports:
viridis,
tidyr,
dplyr,
ggplot2
ggplot2,
magrittr
Suggests:
knitr
Author: Andrew Jackson and Andrew Parnell
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ export(siberEllipses)
export(siberMVN)
export(sigmaSEA)
export(specificCentroidVectors)
importFrom(magrittr,"%>%")
15 changes: 14 additions & 1 deletion R/allCentroidVectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
#' the plots if you ask for it nicely: thedata <-
#' plotCentroidVectors(centroids)
#'
#' @importFrom magrittr %>%
#'
#' @export
# magrittr::`%>%`

allCentroidVectors <- function (centroids, upper = TRUE, do.plot = TRUE, ...) {

# appease CRAN checks
comparison <- NULL

dd <- dim(centroids$r)

# number of pairwise comparisons
Expand Down Expand Up @@ -60,9 +66,16 @@ allCentroidVectors <- function (centroids, upper = TRUE, do.plot = TRUE, ...) {
colnames(distances) <- new.names
colnames(angles) <- new.names

if(do.plot){
siberDensityPlot(distances)
siberDensityPlot(angles)
}

# browser()

# convert from wide to long format
long_data_angles <- tidyr::gather(data.frame(angles),
key = comparison, value = angle)
key = comparison, value = angles)

long_data_distances <- tidyr::gather(data.frame(distances),
key = comparison, value = distances)
Expand Down
13 changes: 7 additions & 6 deletions R/specificCentroidVectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#'
#' @param centroids the list containing distance and angle matrices as returned
#' by \code{\link{siberCentroids}}.
#' @param txt a character vector of the pattern used to find paired matches in
#' @param do.these a character vector of the pattern used to find paired matches in
#' the matrix of all comparisons. Usually the group names within any of the
#' communities.
#' @param upper a logical determining whether to plot the upper or lower
Expand All @@ -19,15 +19,16 @@
#' @return A nice plot. You can get the corresponding matrices used to generate
#' the plots if you ask for it nicely: thedata <-
#' plotCentroidVectors(centroids)
#'
#' @importFrom magrittr %>%
#'
#' @export
# magrittr::`%>%`

specificCentroidVectors <- function (centroids, do.these, upper = TRUE,
do.plot = TRUE, ...) {

# first i need to find all the indices for which the same group name appears
# in the centroid$labels so I can extract them only.
# ** ACTUALLY THIS IS GOING TO BE DONE OUTSIDE**
# appease CRAN checks
comparison <- NULL

# how big is the data array
dd <- dim(centroids$r)
Expand Down Expand Up @@ -86,7 +87,7 @@ specificCentroidVectors <- function (centroids, do.these, upper = TRUE,

# convert from wide to long format
long_data_angles <- tidyr::gather(data.frame(angles),
key = comparison, value = angle)
key = comparison, value = angles)

long_data_distances <- tidyr::gather(data.frame(distances),
key = comparison, value = distances)
Expand Down
15 changes: 3 additions & 12 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
An update to the package `spatstat` on which `SIBER` depends has precipiated a minor version update. My package now uses `spatsat.utils` as per the advice of the package maintainers.
An update to the package `spatstat` on which `SIBER` depends has precipiated a minor version update. My package now uses `spatsat.utils` as per the advice of the dependent package maintainers. There were also some warnings thrown by inappropriate vignette builder options in the yaml headers which have now all been fixed. All issues in the package reports https://cran.r-project.org/web/checks/check_results_SIBER.html have been addressed.

## Resubmission
N/A
Expand All @@ -7,24 +7,15 @@ N/A
N/A

## Test environments
* local OS X 10.10.5 install, R 3.3.3
* local OS X 10.12.4 install, R 3.4.0
* win-builder (R-release) via devtools::build_win()
* win-builder (R-devel) via devtools::build_win()

## R CMD check results
There were no ERRORs, WARNINGs or NOTES on my local build.

There were no ERRORS and 1 WARNING from win-builder on either release or devel.
* checking top-level files ... WARNING
Conversion of 'NEWS.md' failed:
pandoc.exe: Could not fetch https://CRAN.R-project.org/web/CRAN_web.css
TlsExceptionHostPort (HandshakeFailed (Error_Protocol ("certificate rejected: [NameMismatch \"CRAN.R-project.org\"]",True,CertificateUnknown))) "CRAN.R-project.org" 443

This warning appears to be on the CRAN side and is not under my control.

## CRAN Package Check Results for Package SIBER
There was one error thrown by CRAN's remote checks: https://cran.rstudio.com/web/checks/check_results_SIBER.html. I am not concerned about this error as it occurred on the r-oldrel-windows-ix86+x86_64 build and appears to result from an incorrect, inappropriate or missing installation of JAGS on which SIBER depends via the package rjags which also fails on this release with the same error.
+ error: The environment variable JAGS_HOME is set to "c:/Program Files/JAGS/JAGS-4.0.0" but no JAGS installation can be found there.
No ERRORS or WARNINGS.

## Downstream dependencies
There are no downstream dependencies.
Expand Down
8 changes: 4 additions & 4 deletions man/specificCentroidVectors.Rd

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

8 changes: 4 additions & 4 deletions vignettes/Centroid-Vectors.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ angles_distances <- allCentroidVectors(centroids, do.plot = FALSE)
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# function to do the histograms on each group
my.hist <- function(df){
test <- hist(df$angle,
test <- hist(df$angles,
breaks = seq(from = -pi, to = pi, length = 60),
plot = FALSE)

Expand Down Expand Up @@ -116,7 +116,7 @@ print(all.roses)
## ----polar-density, fig.width = 10, fig.height = 7-----------------------

median_vectors <- dplyr::summarise(group_by(angles_distances, comparison),
medAngle = median(angle), medDist = median(distances))
medAngle = median(angles), medDist = median(distances))

origins <- data.frame(comparison = median_vectors$comparison,
x = 0, y = 0)
Expand All @@ -137,8 +137,8 @@ for_arrows <- dplyr::bind_rows(origins, ends)

# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# create the cartesian points for the estimated tips of the arrows
cart_positions <- with(angles_distances, data.frame(x = distances * cos(angle),
y = distances * sin(angle),
cart_positions <- with(angles_distances, data.frame(x = distances * cos(angles),
y = distances * sin(angles),
comparison = comparison ))

# rename as above
Expand Down
8 changes: 4 additions & 4 deletions vignettes/Centroid-Vectors.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The posterior distributions of the angles can then be visualise as a polar histo
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# function to do the histograms on each group
my.hist <- function(df){
test <- hist(df$angle,
test <- hist(df$angles,
breaks = seq(from = -pi, to = pi, length = 60),
plot = FALSE)
Expand Down Expand Up @@ -172,7 +172,7 @@ The names for each comparison are not the prettiest or most informative. Here th
```{r polar-density, fig.width = 10, fig.height = 7 }
median_vectors <- dplyr::summarise(group_by(angles_distances, comparison),
medAngle = median(angle), medDist = median(distances))
medAngle = median(angles), medDist = median(distances))
origins <- data.frame(comparison = median_vectors$comparison,
x = 0, y = 0)
Expand All @@ -193,8 +193,8 @@ for_arrows <- dplyr::bind_rows(origins, ends)
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# create the cartesian points for the estimated tips of the arrows
cart_positions <- with(angles_distances, data.frame(x = distances * cos(angle),
y = distances * sin(angle),
cart_positions <- with(angles_distances, data.frame(x = distances * cos(angles),
y = distances * sin(angles),
comparison = comparison ))
# rename as above
Expand Down
16 changes: 8 additions & 8 deletions vignettes/Centroid-Vectors.html

Large diffs are not rendered by default.

0 comments on commit f039c23

Please sign in to comment.