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

Precision fix #28

Merged
merged 1 commit into from
Nov 22, 2024
Merged
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
2 changes: 1 addition & 1 deletion R/stroke.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
#' Find unique nodes and label them with IDs
#' @noRd
unique_nodes <- function(edge_points) {
nodes <- dplyr::distinct(edge_points, x, y)

Check warning on line 100 in R/stroke.R

View workflow job for this annotation

GitHub Actions / lint

file=R/stroke.R,line=100,col=41,[object_usage_linter] no visible binding for global variable 'x'

Check warning on line 100 in R/stroke.R

View workflow job for this annotation

GitHub Actions / lint

file=R/stroke.R,line=100,col=44,[object_usage_linter] no visible binding for global variable 'y'
nodes$node_id <- seq_len(nrow(nodes))
return(nodes)
}
Expand All @@ -123,7 +123,7 @@
get_links <- function(segments) {
nsegments <- nrow(segments)
links <- data.frame(node_id = as.vector(segments)) |>
dplyr::group_by(node_id) |>

Check warning on line 126 in R/stroke.R

View workflow job for this annotation

GitHub Actions / lint

file=R/stroke.R,line=126,col=21,[object_usage_linter] no visible binding for global variable 'node_id'
dplyr::group_rows() |>
lapply(function(x) (x - 1) %% nsegments + 1)
return(links)
Expand Down Expand Up @@ -226,7 +226,7 @@
norm1 <- sqrt(dx1^2 + dy1^2)
norm2 <- sqrt(dx2^2 + dy2^2)
cos_theta <- dot_product / (norm1 * norm2)
angle <- acos(cos_theta)
angle <- acos(round(cos_theta, 6))
return(angle)
}

Expand Down Expand Up @@ -293,7 +293,7 @@
}

#' @noRd
merge_lines <- function(

Check warning on line 296 in R/stroke.R

View workflow job for this annotation

GitHub Actions / lint

file=R/stroke.R,line=296,col=1,[cyclocomp_linter] Functions should have cyclomatic complexity of less than 15, this has 21.
nodes, segments, links, edge_ids, segments_ids, from_edge = NULL
) {

Expand Down
Loading