skalyan91 / south-up

Code and data for generating a Pacific-centred map with south facing up.
3 stars 1 forks source link

Separate out as funs #5

Closed HedvigS closed 1 year ago

HedvigS commented 1 year ago

@skalyan91 I have an idea, I'd like to use this set-up as a function with arguments. What I've done is separate out the map-script into several scripts.

01_requirements.R = loading and installing packages 02_prep_data.R = all the geos warnlings etc. prints output to rdata 03_funs.R = reads in rdata from 02 and has function that takes argument 04_demo.R = demonstration of 03.

What do you think?

skalyan91 commented 1 year ago

But why define h_load() yourself, instead of just using pacman::p_load()? Does pacman not work with groundhog or something?

Also, now that you’ve saved all the outline and elevation data to an .RData file, I wonder if the code has become sufficiently future-proof that we no longer need to bother with groundhog (at least, for most use-cases).

HedvigS commented 1 year ago

But why define h_load() yourself, instead of just using pacman::p_load()? Does pacman not work with groundhog or something?

I had some problem before with pacman::p_load() so now I have the habit of using a function i wrote myself. but we can switch back, no worries.

The idea was that once step 02 is cleared, users wouldn't actually have to do the groundhogstuff because they don't need to run those functions if they just use the output of 02-script.

Also, now that you’ve saved all the outline and elevation data to an .RData file, I wonder if the code has become sufficiently future-proof that we no longer need to bother with groundhog (at least, for most use-cases).