Skip to content

Add dissmapR R package#68

Draft
macSands wants to merge 10 commits intomainfrom
software_pages_update_sandra
Draft

Add dissmapR R package#68
macSands wants to merge 10 commits intomainfrom
software_pages_update_sandra

Conversation

@macSands
Copy link
Collaborator

Add first pages for new dissMapR and invasiMap R packages in development. Software repositories 'https://b-cubed-eu.github.io/dissmapr/' and 'https://b-cubed-eu.github.io/invasimapr' still to be created, so links won't work yet. With the new 'Astro + Starlight project' structure, I'm not sure where to update navigation tab.

Add first pages for new dissMapR and invasiMap R packages
@macSands macSands added the content Suggestions for content label Jan 31, 2025
@peterdesmet
Copy link
Collaborator

Thanks @macSands!

I see you took inspiration from the gcube page, which makes sense. We'll change that up a bit though and include the external tutorials directly into the website. Here's how it will look:

  • A directory src/content/docs/software/dissmapr/
  • One file for each tutorial, e.g. metric-computation.md
  • Those files will be copied/generated from the source files in the dissmapr repository, by a function @sannegovaert will make.
  • We'll periodically rerun the function for all external tutorials, so we catch updates.

It's very good for us to know that the dissmapr and invasiMap packages and related tutorials are coming, but given that 1) we'll change the way we're adding them to the website (semi-automatically) and 2) they're currently not there yet, I'm going to keep this pull request in draft form until we have concrete files to parse.

FYI: the navigation is maintained here:

{
label: 'Software',
// autogenerate: { directory: 'software' },
items: [
'software/gbif-api',
'software/gcube'
],
collapsed: true,
},

Right now the software tutorials are added manually to the navigation, but after the switch we'll set that to autogenerate.

@peterdesmet peterdesmet marked this pull request as draft January 31, 2025 09:00
@peterdesmet peterdesmet requested review from sannegovaert and removed request for mtrekels January 31, 2025 09:01
@sannegovaert
Copy link
Member

I noticed the repositories are created, so I started to add dissmapr to the documentation website.

We read each .Rmd file and produce a .md file and figures that are added to the website.

However, our method does not work here because the Rmd files use an external .Rmd file.
{r child-2, child = "_common.Rmd"}

Warning in file(con, "r") :
  cannot open file 'C:/Users/SANNE_~1/AppData/Local/Temp/RtmpMV10n6/rmd_file/_common.Rmd': No such file or directory

@peterdesmet peterdesmet added this to the 1.0 milestone Sep 17, 2025
@sannegovaert
Copy link
Member

I noticed the repositories are created, so I started to add dissmapr to the documentation website.

We read each .Rmd file and produce a .md file and figures that are added to the website.

However, our method does not work here because the Rmd files use an external .Rmd file. {r child-2, child = "_common.Rmd"}

Warning in file(con, "r") :
  cannot open file 'C:/Users/SANNE_~1/AppData/Local/Temp/RtmpMV10n6/rmd_file/_common.Rmd': No such file or directory

Hi @macSands: Would it be possible to not use external files in your .Rmd so I can add your documentation to the website?

@sannegovaert
Copy link
Member

Ping @macSands

@macSands macSands marked this pull request as ready for review January 26, 2026 11:31
Copy link
Member

@sannegovaert sannegovaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @macSands
Good to see that your tutorials are ready to be added to the documentation website. However, it is not possible to add them for now, as I commented above.

We read each .Rmd file and produce a .md file and figures that are added to the website, with this script, using the function b3doc::rmd_to_md().

However, our method does not work here because the Rmd files use an external .Rmd file.
{r child-2, child = "_common.Rmd"}

Warning in file(con, "r") :
  cannot open file 'C:/Users/SANNE_~1/AppData/Local/Temp/RtmpMV10n6/rmd_file/_common.Rmd': No such file or directory

I can only add your tutorials if no external files are used to created the vignettes.

Also, all dependencies need to be listed in the vignettes.yml file under dependencies, for each vignette seperately. I had added those for each of your vignettes for each package that you load with library(). This is to make sure that all the needed packages are installed on the computer that recreates the markdown files. But you changed this to dissmapr dplyr knitr for all vignettes, while many more packages are used in the vignettes.

@peterdesmet peterdesmet changed the title Add dissMapR and invasiMapR software pages Add dissmapR R package Jan 29, 2026
@sannegovaert
Copy link
Member

sannegovaert commented Feb 18, 2026

@macSands, As we discussed during our meeting, these are the next 2 steps:

  • Clean up the loaded packages in the vignettes, only load what is necessary (library()), and list these in the vignettes.yml file.
  • Make sure the data is imported correctly. I now have an error:
Scherm­afbeelding 2026-02-18 om 15 31 07

I recommended you during the meeting to work with data functions. It is good to have this for an example dataset you work with. However, this might not be the best solution after all for your situation where you need to save snapshots of the data during the analysis. Here you can find more info. So your solution to store the data in data/ or inst/extdata/* is probably better but is not implemented correctly yet (do not use vignettes/data/).

*I am confused because the software requirements of B-cubed say: "Data files included in the repository MUST be placed in the data/ directory (and inst/extdata/ for R packages).", while the R package guide advises to use data/ to store R objects and inst/extdata for raw files.

Also be aware that all the data together cannot be too big when you are submitting your R package to Cran.

@sannegovaert sannegovaert marked this pull request as draft February 23, 2026 14:13
@sannegovaert sannegovaert marked this pull request as draft February 23, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content Suggestions for content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants