ESHackathon / CiteSource

http://www.eshackathon.org/CiteSource/
GNU General Public License v3.0
16 stars 1 forks source link

Rewrite examples to show real use #200

Open LukasWallrich opened 2 months ago

LukasWallrich commented 2 months ago

Currently, some examples still refer to the development stage when functions were written to work on their own - and offer little information on how functions hang together ... for instance, ?plot_source_overlap_heatmap. To make them useful, we should rewrite them to (usually) start from example citations and produce a meaningful output.

@rootsandberries might you be able to have a look at that?

LukasWallrich commented 2 months ago

(On that note, we should also let examples run where possible - too many are wrapped in if (interactive()), which makes it harder to catch broken examples, such as compare_sources())

rootsandberries commented 2 months ago

I'm not sure I totally understand this, but once I get back into the vignettes, maybe it will become clear. If not, I will let you know!

TNRiley commented 2 months ago

@rootsandberries @LukasWallrich I'd be happy to review the examples and see what needs to be changed.

TNRiley commented 1 month ago

I'm thinking we can use a small subset of the new vignette data (7-10 rows?) and use real examples that would be meaningful. It should be easy to create the examples running only a few citations.

LukasWallrich commented 1 month ago

To make the plots meaningful, we might need more - but if we remove the abstracts, even 100 refs will be very lightweight.

TNRiley commented 1 month ago

To make the plots meaningful, we might need more - but if we remove the abstracts, even 100 refs will be very lightweight.

We could probably have a sample of 100 from a sample of the vignettes where we strip the abstracts for example data.

rootsandberries commented 1 month ago

I'm afraid I'm just not understanding this train of thought--maybe we can discuss this at an upcoming meeting!

TNRiley commented 1 month ago

I'm afraid I'm just not understanding this train of thought--maybe we can discuss this at an upcoming meeting!

No problem, we can discuss. In general functions have examples in their comments and those examples are what the tests check to make sure the function is working correctly, it is also used to show a user what the function is doing. We can set aside some citation data in .ris or .csv form that the examples could use, rather than using data that isn't really useful.

Since we'll have data that's used for the vignettes, I was just thinking we could pull some citation data from that for our examples.

rootsandberries commented 1 month ago

I see...thanks Trevor! I'm not familiar with these examples, so perhaps best if we chat about this before I try to change anything :-)

TNRiley commented 1 month ago

I still struggle a bit with examples, they are a bit special, but worth understanding! Happy to work with you on this :)