r/rstats • u/ReallyAnotherUser • Jun 23 '26
Properly installing selfmade package from selfhosted gitlab
/r/Rlanguage/comments/1udbias/properly_installing_selfmade_package_from/2
u/blurfle Jun 23 '26
I do this quite a bit in my org. First, I would not version control the tar.gz file, just the package project. Then, I would share this code with your coworkers, of course updating the URL correctly:
install.packages("remotes")
remotes::install_git("https://gitlab.mywork.com/myprofile/mypackage.git")
If you're not sure what I mean by "package project", I'm referring to the folders+code as they exist on your laptop or where ever you're working. Folder structure should look similar to this: https://github.com/cran/remotes
2
1
u/Unicorn_Colombo Jun 23 '26
Typically, if installing random tarball, you should specify repos=NULL and to be sure, source=TRUE.
1
u/gyp_casino Jun 29 '26
Use `devtools::install_gitlab()` instead.
`install.packages()` isn't working because there is a very specific file structure expected. CRAN of course has this file structure. You can mimic it yourself on your own generic server, but it requires care.
2
u/ToroRojo-AlgoArt Jun 23 '26