-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General Issue: create_blogpost.R checks for and installs packages #245
Comments
sounds like a great idea @bms63 ! |
god...teal has so many dependencies... |
Why not |
I am always weary of having just installed teal and mirai and I wondering if there is a way to not have to install them for new posters - just takes forever. guess the docker image could be handy???? |
I wonder if there is a way where only a select few blogposts render, plus the new one? |
Yeah I always temporarily delete ~40 posts to render the website! |
This is sort of a tough one. @cicdguy and @pawelru any recommendations? We grew too big and have way too many blog posts! Installing all the packages takes some time and rendering all the posts take some time. This is a "beginner" blog and want to keep it simple/low barrier for folks wanting to come and write a post so some solutions (e.g. Docker) might be beyond our base. Any ideas on how we can keep the barriers low for beginners and keep things minimal for us? |
I see two options:
By any means - I do not recommend to maintain a list of packages with its dependencies (!). Some of those packages are still under development and the dependencies are in scope of a change. Let it be identified automatically. There are tools for that. And let it be a low maintenance thing from our side. (That's for |
Thanks @pawelru - I agree we should move to a package-like structure and take advantage of some of these r-libs actions. I am also interested in making blog contributors have a really easy time writing a post and looking at ways to help minimize setup and headaches for them. I am assuming a completely newb-like person here! |
Background Information
@StefanThoma and @manciniedoardo what do you all think about check and installing packages when you create a blog post. could just be another helper file that create_blogpost calls??
packages to install
Helper program to check and install packages
check_and_install <- function(packages) {
for (package in packages) {
if (!require(package, character.only = TRUE)) {
install.packages(package, dependencies = TRUE)
library(package, character.only = TRUE)
} else {
message(paste(package, "already installed"))
}
}
message("Let's program some ADaMs!")
}
Use the function
check_and_install(c(
packages here...
))
The text was updated successfully, but these errors were encountered: