AnnieHow / dod

dod package development
https://anniehow.github.io/dod/
3 stars 0 forks source link

Create error message if user provides incorrect item name #6

Closed j-harbin closed 2 years ago

j-harbin commented 2 years ago

Right now, in dod.ctd(), the user has the option to provide item="index" to obtain a data frame that contains a list of file names and the time. They can then take the list of file names and do a further step similar to the following:

dod.ctd("BBMP", 2005, "CTD_BCD2005667_1_1_DN.ODF")

We need to print an error message if the user does not provide a correct file name.

dankelley commented 2 years ago

Agreed. Also, pretty soon, we'll want to recode some of this in a function that wraps download.file() in a try block, so we can print nice messages, use destdir and so forth. (PS. dod.ctd() needs a destdir parameter.)

AnnieHow commented 2 years ago

Addressed during zoom with Dan, it's been working since adding dod.download; see below (the ID is wrong)

Screen Shot 2022-10-11 at 9 42 29 AM
j-harbin commented 2 years ago

@dankelley, with the screen shot that @AnnieHow provided above, is it okay that we see the red writing before the grey box? I would expect to only see what is shown in the light gray box. If it's okay that the stuff before the grey box is being printed out this issue can be closed again and so can https://github.com/AnnieHow/dod/issues/24

dankelley commented 2 years ago

@j-harbin and maybe @AnnieHow -- feel like a Z to chat about this? I'm avail. (We should not put zoom links here on GH.)

j-harbin commented 2 years ago

Fixed after a Z with AH and DK in commit 29a639e11cc3df97f488d18a74b910d596d382c2 . See screen shot below Screen Shot 2022-10-31 at 7 54 39 AM