Novartis / xgxr

R package for supporting exploratory graphics at http://opensource.nibr.com/xgx
Other
13 stars 7 forks source link

Refine `xgx_save` to give more information on error. #34

Closed mattfidler closed 3 years ago

mattfidler commented 3 years ago

If dirs in xgx_save is not a list the error is not very readable:

R 3.6.1> xgx_save(PC$pptWidth, PC$pptWidth, DIR$out, "bcva-vs-time", g=gg)
Error: $ operator is invalid for atomic vectors

Expected behavior A better way to handle this is to make sure that dirs is a list. If not, tell the user what the structure of this list should be.

This depends on the DaVinci xgxr

iamstein commented 3 years ago

Thanks @mattfidler. We could introduce a check that it's a list. But also, just curious, how did you use it, just as a string for the output directory?

mattfidler commented 3 years ago

I did; I misread the comment on the xgxr website and that was my assumption.