Skip to content

Commit

Permalink
human_filesize(): avoid Note during pkg installation *
Browse files Browse the repository at this point in the history
The note was: 'Note: wrong number of arguments to 'floor' at filemanagement.R:258'.

Introduced by 6a3b0ee, where '%>% floor' was replaced by '%>% floor()'. The Note can
be regarded as a bug in R.

Worked around by using '%>% floor(x = .)'
  • Loading branch information
florisvdh committed Nov 24, 2023
1 parent c03c4e4 commit d300e4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/filemanagement.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ human_filesize <- function(x) {
assert_that(all(x %% 1 == 0 & x >= 0))
magnitude <-
log(x, base = 1024) %>%
floor() %>%
floor(x = .) %>%
pmin(8)
unit <- factor(magnitude,
levels = 0:8,
Expand Down

0 comments on commit d300e4a

Please sign in to comment.