Re: [Rd] head with non integer n returns confusing output

2019-06-22 Thread Abby Spurdle
> `head()` returns a problematic output when a character is fed to its `n` > parameter. > this can lead to an unexpected and inconsistent result. > I would suggest either using `as.integer` consistently on the input, or > having a consistent error for all character input. I use the head() and tail

[Rd] head with non integer n returns confusing output

2019-06-21 Thread Ant F
Dear all, `head()` returns a problematic output when a character is fed to its `n` parameter. doubles and logicals are converted to integer as if `as.integer` was used, which I think is intuitive enough : ``` head(1:10, 4.1) # [1] 1 2 3 4 head(1:10, 4.9) # [1] 1 2 3 4 head(1:10, TRUE) # 1 hea