> `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() functions, a lot. I agree that the argument checking and argument handling is not as good as it could be. In march I posted the following thread: https://stat.ethz.ch/pipermail/r-devel/2019-March/077512.html https://stat.ethz.ch/pipermail/r-devel/2019-March/077527.html Perhaps, head (1:10, "foo"), should return a clear error message... Then it's up to the user to convert strings to integers, if that's want he or she wants to do. [[alternative HTML version deleted]] ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel