tiernanmartin / drakepkg Goto Github PK
View Code? Open in Web Editor NEWDemonstrate A Drake Workflow Package
License: Other
Demonstrate A Drake Workflow Package
License: Other
While working within the drakepkg
directory itself, it would be nice if I could make()
plans that include filepaths in the inst/
directory.
That won't work because when a user installs the package, the sub-directories of inst/
are moved to the package root directory which breaks the filepaths included in the plan.
That way, once I merge ropensci/drake#491, users will be able to download the project with drake_example("drakepkg")
, and it will show up in drake_examples()
. Ref: ropensci/drake#490.
I have been thinking about your question from ropensci/drake#471 (comment), and I feel more strongly about distributing plans as functions rather than datasets. The functions I have in mind would have all relevant calls to drake_plan()
, evaluate_plan()
, bind_plans()
, etc. This encourages good practice since the generating code of the plan is important to have on hand, and it gives you flexibility for generating different versions of the same plan. Also, users of drakepkg
can see how your plans are generated, and it could help them generate their own plans.
#' @title Get a simple plan
#' @description Generate the plan from `drake_plan()` and friends.
#' @export
#' @return a `drake` plan
#' @param n number of replicates
get_simple_plan <- function(n = 2){
subplan1 <- drake_plan(x = a__) %>%
evaluate_plan(wildcard = "a__", values = seq_len(n))
subplan2 <- drake_plan(y = b__) %>%
evaluate_plan(wildcard = "b__", values = seq_len(n))
bind_plans(subplan1, subplan2)
}
I see that report.Rmd
is in inst/doc
, but this folder is deleted by the default RStudio build step; see r-lib/pkgbuild#58.
Does this not happen when you build this package? inst/reports
? Thanks.
Are there examples how to implement tests using testthat and drake?
See #4 (comment)
... unless you want it to.
The default should probably be that plans/
and doc/
are overwritten every time but extdata/
only gets overwritten when the user tells the function to.
copy_pkg_files <- function(to = getwd(),
overwrite_plans = TRUE,
overwrite_doc = TRUE,
overwrite_extdata = FALSE){
...
}
@tiernanmartin Thanks for developing drakepkg
! I found it 2 weeks ago when I was researching ways to package a drake
workflow for a research project I plan to publish as a "research compendium" (according to the methods outlined by @benmarwick in rrtools
).
I have since been working on an alternative to your approach which I have now uploaded to a fork of your repo here.
The main difference, I think, is that I also distribute the .drake/
directory with the package, so that users can check the consistency of the workflow with all its inputs and outputs and can check out intermediate results/targets, without having to re-run the analysis on their own computer. The package includes simple wrapper functions that are intended to lower the barrier for the user to interact with the analysis (e.g., just running reproduce_analysis()
is enough to copy and check the analysis). I wrote a vignette that hopefully explains the procedure well.
I am interested in your thoughts on my approach. Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.