HedvigS / Glottolog_look_up_table

1 stars 0 forks source link

Missing dependency mapproj for Worldmap_plotting.R #1

Closed xrotwang closed 3 years ago

xrotwang commented 3 years ago

It would be nice, if there'd be a minimal requirements.R for Worldmap_plotting.R. With the dependencies as specified now, starting from a fresh R installation, the script takes quite some time.

HedvigS commented 3 years ago

Yes, it does because I decided to use groundhog. I had been thinking about giving people an option for something that isn't version-controlled if they don't want to sit through that the first time. Mind you, it only really takes time the first time through.

HedvigS commented 3 years ago

The title of this issue, was there actually something missing or just that you wanted another alternative that takes less time?

xrotwang commented 3 years ago

Yes, there was. mapproj was missing.

Hedvig Skirgård @.***> schrieb am Mo., 22. März 2021, 20:41:

The title of this issue, was there actually something missing or just that you wanted another alternative that takes less time?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/HedvigS/Glottolog_look_up_table/issues/1#issuecomment-804343476, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGUOKASMADIOW3K7VFFMEDTE6MP7ANCNFSM4ZTOK5LA .

xrotwang commented 3 years ago

Sorry for the lack of coherence between issue title and content. "Minimal requirements" is the link here: mapproj seemed to be missing, while tidyverse, ape, phytools, etc. are probably not needed.

HedvigS commented 3 years ago

That's quite odd, because I don't use either of the two functions of the mapproj package. I use coord_map() which is a function of ggplot2, which loads and installs fine. It could be that groundhog is not installing dependencies correctly, and that one of the other map packages calls in mapproj in some way. It seems like you don't want groundhog to be used for glottolog cookbook scripts so I'll use regular library etc instead for those scripts.

HedvigS commented 3 years ago

As to the other thing, personally the way I do things is I have a requirements script which loads everything needed for all scripts in that package. I won't do that for scripts for your glottolog cookbook though, so don't worry about it.

Tidyverse is needed in the worldmap script.

xrotwang commented 3 years ago

I think using groundhog is fine. I just wouldn't want to explicitly override its default functionality to write directories to the cwd.

xrotwang commented 3 years ago

tidyverse says it is "an opinionated collection of R packages". From my point of view, it would be a service to a user of a script, to just require the actual packages that are used, and not the whole collection (in particular because "opinionated" often is close to "controversial", and AFAIR, tidiverse ended up requiring 85 packages).

HedvigS commented 3 years ago

I can load the specific tidy verse packages that are needed. That's not commonly how things are done in tidyverse-R though, but if you prefer it I can adjust.

xrotwang commented 3 years ago

My generic preference is "minimal requirements". In the R world, requiring tidyverse seems to be some sort of position statement (see http://www.pieceofk.fr/exploring-the-cran-social-network/).

HedvigS commented 3 years ago

I think loading tidyverse as a whole is done because it's just simpler and shorter, and most of us use several of the tidyverse packages often. I don't have to load tidyverse packages like that though, I can load specific ones instead and I'll do that for you.

tidyverse vs base is another discussion, and I often find one that people overdramatise. Legibility and decent speed and effort is what I value, and overall my experience is that people who use tidyverse-pacakges tend to write more legible code over all.

HedvigS commented 3 years ago

I realise perhaps I need to clarify, I'll still use tidyverse packages (like "dplyr"), but I won't load all of tidyverse. dplyr is still a part of this opinionated set of packages.

dplyr is extremely similar to pandas, see this comparison table for example

xrotwang commented 3 years ago

I don't object to using any particular package. I just think including a pre-packaged collection, pulling in 85 packages, wholesale is not the most user-friendly solution to requirements management for sharing a small script.

HedvigS commented 3 years ago

Okay great. It seemed for a while there that you were objecting to using any tidyverse packages, not just the loading of them wholesale.

HedvigS commented 3 years ago

I've seen to the missing packages issue in the script I'm prepping for glottolog/cookbook. I thought they would have loaded as dependencies by other packages, but alas this isn't the case. It's solved now anyway so I'll close this issue.