Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better corners docs #37

Merged
merged 6 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ jobs:
- name: Install bcftools
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install bcftools build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev
sudo apt-get update
sudo apt-get install bcftools build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev libharfbuzz-dev libfribidi-dev

- name: Install package
run: |
Expand Down
2 changes: 1 addition & 1 deletion lostruct/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LazyData: true
Imports:
RSpectra,
data.table
RoxygenNote: 5.0.1
RoxygenNote: 7.2.3
Suggests:
knitr,
testthat,
Expand Down
32 changes: 26 additions & 6 deletions lostruct/R/corners.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
#' Find Points in a 2D Cloud Closest to the "Corners"
#'
#' Finds the k "extreme points" that lie closest to the minimal enclosing circle,
#' and returns a matrix with k columns containing the portion of points
#' that lie closest to those extreme points.
#' Finds the 'k' "extreme points" (the "corners") that lie closest
#' to the minimal circle enclosing the input collection of points
#' in two dimensions, and returns for each of these corners
#' which of the input points are closest to that corner.
#' The return value is a matrix with 'k' columns,
#' whose 'i'-th column contains the indices of those points
#' that lie closest to the 'i'-th corner.
#'
#' If the output is 'out', then 'out[,i]' is a vector of
#' length 'nrow(xy) * prop' for which 'xy[ out[,i], ]' is
#' the coordinates of the closest points to the 'i'th corner.
#' The rows of 'out' are in no particular order.
#'
#' If k is larger than the number of points on the minimal enclosing circle,
#' adds the closest points to that circle that are not in previously added points' neighborhoods
#' until k is reached.
#' this adds the closest points to that circle that are not in previously
#' added points' neighborhoods until k is reached.
#' If k is less than 3, this will behave as if k=3.
#'
#' @param xy A two-column numeric matrix of coordinates.
#' @param prop The proportion of points to return for each corner.
#' @return A three column integer matrix giving the indices of the corresponding points.
#' @param k The number of corners (should be at least 3).
#' @return A k-column integer matrix whose i-th column gives the indices of the points closest to the i-th corner.
#'
#' @examples
#' xy <- runif(200) |> matrix(ncol=2)
#' out <- corners(xy, k=4, prop=0.05)
#' \dontrun{
#' plot(xy)
#' for (i in 1:4) points(xy[out[,i],], col=i, pch=20, cex=2)
#' }
#' @export
corners <- function (xy, prop, k=3) {
xy <- as.matrix(xy)
Expand Down
6 changes: 3 additions & 3 deletions lostruct/man/as.winfun.Rd

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

35 changes: 28 additions & 7 deletions lostruct/man/corners.Rd

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

9 changes: 6 additions & 3 deletions lostruct/man/cov_pca.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/dim.winfun.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/dist_sq_from_pcs.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/eigen_windows.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/eigen_windows_matrix.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/eigen_windows_winfn.Rd

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

4 changes: 2 additions & 2 deletions lostruct/man/enclosing_circle.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getCircleFrom3.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getMaxPairDist.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getMaxRad.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/getMinCircle.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/isBiggerThan90.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/multi_vcf_query.Rd

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

3 changes: 1 addition & 2 deletions lostruct/man/multi_vcf_query_fn.Rd

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

5 changes: 2 additions & 3 deletions lostruct/man/pc_dist.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/read_tped.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/read_vcf.Rd

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

9 changes: 6 additions & 3 deletions lostruct/man/recode_numeric.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/region_string.Rd

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

5 changes: 3 additions & 2 deletions lostruct/man/running_cov.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/vcf_positions.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/vcf_query.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/vcf_samples.Rd

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

10 changes: 7 additions & 3 deletions lostruct/man/vcf_windower.Rd

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

1 change: 0 additions & 1 deletion lostruct/man/winfun_matrix.Rd

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

Loading