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

fix NA introduced into position #565

Merged
merged 1 commit into from
Jul 27, 2022

Conversation

andyquinterom
Copy link
Contributor

@andyquinterom andyquinterom commented Jul 25, 2022

Resolves #564

R/utils.R Outdated
@@ -425,6 +425,7 @@ code_point_to_unit <- function(line, pts) {
m <- offsets[n]
result[pts >= n] <- m
result[is.infinite(pts)] <- m
result[is.na(pts)] <- m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we could just replace

result[is.infinite(pts)] <- m

with

result[!is.finite(pts)] <- m

and both Inf and NA cases are handled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me

@andyquinterom
Copy link
Contributor Author

Fixed!

Copy link
Member

@renkun-ken renkun-ken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NA introduced into position when opening curly braces
3 participants