Merck / pkglite

Compact Package Representations
https://merck.github.io/pkglite/
GNU General Public License v3.0
30 stars 4 forks source link

Updating documents #49

Closed jhk0530 closed 4 months ago

jhk0530 commented 4 months ago

Hi, thanks for nice package. Honestly, I think it's super cool.

As I understand, I can bring some R package as text file to isolated development environments.

I was checking out the Get started and Articlec and had a question, so I raised an issue.

In Curate File Collections , there's code below which I understand as "You can select your R package's contents as you want to pkglite" not only the file_default

library("pkglite")
pkg <- system.file("examples/pkg1/", package = "pkglite")

fc <- merge(
  pkg %>% collate(file_root_core()),
  pkg %>% collate(file_r()),
  pkg %>% collate(file_r(), file_man())
)

If so, shouldn't the last line have collate(file_r(), file_man()) with file_r() as a duplicate? Because it's already included in line before.

So I was confused about last line is meant to be show collate function can take multiple parameters or typo. If is intended, it may good to give comment like #collate can have multiple file_* functioins or remove file_r().

fc <- merge(
  pkg %>% collate(file_root_core()),
  pkg %>% collate(file_r()),
  pkg %>% collate(file_r(), file_man()) # you can use multiple file collections in collate
)

fc <- merge(
  pkg %>% collate(file_root_core()),
  pkg %>% collate(file_r()),
  pkg %>% collate(file_man()) 
)

Thanks !

nanxstats commented 4 months ago

Yes, it's intentional.

This operation returns the union of the files.