trinker / pacman

A package management tools for R
311 stars 37 forks source link

Change unclear errors to specific warning when no packages are specified #137

Open LukasWallrich opened 3 years ago

LukasWallrich commented 3 years ago

I am currently using pacman while teaching a course on reproducible research and the students find it very helpful - so thank you for this great package. However, novices make creative mistakes that currently result in unclear error messages, while the intended behaviour seems different.

Specifically, calling p_load() results in Error in match.call(expand.dots = FALSE)[[2]] : subscript out of bounds, while p_load(character.only = TRUE) results in Error in if (p_loaded(char = package)) { : argument is not interpretable as logical

The intended behaviour of the code seems to be to just return invisible()? In the first set of edits, I enable it to reach that condition. However, it would seem likely that these calls are usually mistakes, so that a warning would be helpful? I have added that in line 58. With this, I hope to be able to make a small contribution - of course, I am happy for you to address this in any other way as well.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 0.0% when pulling 6ff4e61ce2da7b0f1985e513fd6889703f8810ff on LukasWallrich:patch-1 into ace0936406ca0186a67ee0f5cd52698f663780db on trinker:master.