Error in load (file, via GUI) - Improve underlying code?

Using the GUI, environment tab, 'open folder' icon - I thought this was for loading files but the dialog box says 'load workspace' so maybe this is my bad already, though this is still a common mistake. This seems to be a GUI wrapped around load() which therefore works for load()able files/workspaces but fails for others.

3 examples of other folks running into the same issue. Seems to me that the problem is that the folder icon looks like 'open' and prompts load() which will work sometimes, thus doesn't necessarily train users not to use it. Notwithstanding there could be a myriad of filetypes that users want supported, it occurs to me that this feature could have a smarter iterative backend which scans the filetype extension and cues up the appropriate importing function. Certainly it seems jarring that Rds files - R natives - don't work with RStudio's Open icon.

An alternative approach (worse IMO but still more helpful) would be to insert warning text along the lines of "This feature uses the load() function which is only appropriate for filetypes A B and C; attempting to load Xls family, Rds family, D E F G types will fail with various errors or warnings which may incorrectly suggest your data are corrupt. Please use the appropriate importing function for these types".

The current situation whereby one can use an 'open' icon to try to open a R native file that one created hours before, and be told the file may be corrupted and was saved with an older version, seems like an undersirable sharp edge.

Cheers!

If you want to import a dataset the icon is two to the right of the load workspace icon.

Loading a workspace (normally .RData) is different to importing a dataset. .Rds files are not workspaces, but are also not necessarily datasets so I guess this is why they are not covered by either option. If you know what a .Rds object is you probably won't need to use the menu anyway.

Fair points. I guess I'm just thinking from the perspective of what the GUI (/any GUI) is for - ostensibly to be a quick & easy shortcut to common features, and to make complex things (R) more available to less skilled practitioners. But if features are easily (mistakenly) misused - as those example links shows that this seems to be - there's a case to be made that they may be doing more harm than good, and thus candidates for improvement.

In starting this thread I've realised that there is no GUI option within RStudio to open Rds files, which seems odd given associating RStudio with them in one's OS means they open in RStudio...

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.