Open pgensler opened 7 years ago
Not sure you're filing this in the right place?
Correct me if I'm wrong, but I'm pretty sure this is the intent of the package:
"The goal of strict to make R behave a little more strictly, making base functions more likely to throw an error rather than returning potentially ambiguous results."
I don't know about you, but having a "magic number" error is not exactly the easiest error to understand and I would argue it's somewhat ambiguous, and does not really make me "fall into a pit of success". Is the intent of the package to make the errors in R more informative?
Perhaps I am mislead, but isn't the point of the package meant to give stricter (and more informative errors), so that one is able to succeed in R (fail fast, and often mentality)?
But the code is generated by double clicking, which I have no control over.
I understand your point, which, to be fair the issue is more about how the R GUI behaves with .rds files.
I still think it would be helpful to create a wrapper around the original error, which forces the user to always use readRDS()
at the very least for reading in .rds
files.
Maybe a better question to ask is this: is using readRDS always applicable to reading in .RDS files? Should you use a different approach? Even if you called mean(foorbar.rds)
, would strict
return an informative error?
I understand you don't want to make a wrapper around all of the existing error messages in R, but I think it would strongly benefit users who are maybe new, or simply are trying to find a solution to reading in a file.
@pgensler, sounds like a bug in whichever IDE you are using which ought to be fixed. Is it RStudio?
Double clicking a .rds file will automatically open the file with a
load
function call, which throws a very terse error:Maybe forcing a user to explicitly use read_rds when reading in a .rds file is a good idea?