Skip to content

Improve type-checking#414

Merged
hfrick merged 7 commits intomainfrom
claude-code
Jan 25, 2026
Merged

Improve type-checking#414
hfrick merged 7 commits intomainfrom
claude-code

Conversation

@hfrick
Copy link
Member

@hfrick hfrick commented Jan 25, 2026

to test-drive the CC skill for the rlang type checkers

Comment on lines +96 to +97
# only do this after `arg` is used but do it because
# this makes x0[known] <- as.integer(x0[known]) below work for e.g. c(1, 10)
Copy link
Member Author

Choose a reason for hiding this comment

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

x <- c(1, 10)
class(x)
#> [1] "numeric"
typeof(x)
#> [1] "double"
purrr::map(x, typeof)
#> [[1]]
#> [1] "double"
#> 
#> [[2]]
#> [1] "double"

x1 <- as.integer(x)
class(x1)
#> [1] "integer"
typeof(x1)
#> [1] "integer"
purrr::map(x1, typeof)
#> [[1]]
#> [1] "integer"
#> 
#> [[2]]
#> [1] "integer"

# but
x[c(TRUE, TRUE)] <- as.integer(x)
class(x)
#> [1] "numeric"
typeof(x)
#> [1] "double"
purrr::map(x, typeof)
#> [[1]]
#> [1] "double"
#> 
#> [[2]]
#> [1] "double"

Created on 2026-01-25 with reprex v2.1.1

@hfrick hfrick merged commit 11ec401 into main Jan 25, 2026
15 checks passed
@hfrick hfrick deleted the claude-code branch January 25, 2026 16:37
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.

1 participant