Skip to content

Commit

Permalink
0.2.5 candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
robchallen committed Nov 17, 2022
1 parent 3995087 commit 6d8865f
Show file tree
Hide file tree
Showing 132 changed files with 221 additions and 167 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dtrackr
Title: Track your Data Pipelines
Version: 0.2.4.9001
Version: 0.2.5
Authors@R:
person(given = "Robert",
family = "Challen",
Expand Down
12 changes: 8 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ transmute, ungroup
* Print and plot S3 methods for history graph.
* Vignette fixes.
* Non breaking changes to API so bumping to new minor version for CRAN submission.
* (Version to stay unstable until CRAN submission complete)

# dtrackr 0.2.5

Expand All @@ -67,6 +66,11 @@ dtrackr Coverage: 83.60%,
R/dot.R: 78.12%,
R/dtrackr.R: 84.08%) mostly through examples
* improved error handling and reporting in mutate functions.
* issues: documentation results in examples tests running multiple times.
* TODO: (next version) exclusions in joins.
* Logo.
* bug #25 & #26 fixes:
* Logo and documentation fixes.

* issues: re-use of documentation results in examples tests running multiple times.
* TODO: (next version) exclusions in joins
* TODO: (next version) better support for long format tables
* TODO: (future version) column level tracking (prototyped in 0.2.5)

41 changes: 29 additions & 12 deletions R/dtrackr.R
Original file line number Diff line number Diff line change
Expand Up @@ -1166,12 +1166,22 @@ p_include_any = function(.data, ..., .headline=.defaultHeadline(), na.rm=TRUE, .
for(filter in filters) {
glueSpec = rlang::f_rhs(filter)
filt = rlang::f_lhs(filter)
out = out %>% dplyr::group_modify(function(d,g,...) {
d %>%
dplyr::mutate(.incl = rlang::eval_tidy(filt,data = d, env=.env)) %>%
# out = out %>% dplyr::group_modify(function(d,g,...) {
# d %>%
# dplyr::mutate(.incl = rlang::eval_tidy(filt, data = d, env=.env)) %>%
# dplyr::mutate(.incl.na = ifelse(is.na(.incl),!na.rm,.incl)) %>%
# dplyr::mutate(.retain = .retain | .incl.na)
# })
# Fix for github issue #26. I didn't want to do this in a group_modify as it loses the grouped
# columns (which I could have reassembled with the g parameter). Instead I am doing this
# in a standard mutate using the dplyr::cur_data_all. This behaviour is demonstrated here:
# iris %>% group_by(Species) %>% filter(rlang::eval_tidy( quo(Petal.Width==max(Petal.Width)), data = cur_data_all()))
# where the result should be 5 long with entries for each Species.
out = out %>%
dplyr::mutate(.incl = rlang::eval_tidy(filt, data = dplyr::cur_data_all(), env=.env)) %>%
dplyr::mutate(.incl.na = ifelse(is.na(.incl),!na.rm,.incl)) %>%
dplyr::mutate(.retain = .retain | .incl.na)
})

tmp = out %>%
dplyr::summarise(
.count = dplyr::n(),
Expand Down Expand Up @@ -1935,12 +1945,15 @@ p_setdiff = function(x, y, ..., .messages="{.count.out} items in difference", .h
x = x %>% .untrack()
y = y %>% .untrack()
#.env = environment()
if (is.null(names(by))) {
.keys = paste0(by, collapse = ",")
if (is.null(by)) {
# Fix of #25 - the natural join when columns are not specified
.keys = paste0(intersect(colnames(x),colnames(y)), collapse = ", ")
} else if (is.null(names(by))) {
.keys = paste0(by, collapse = ", ")
} else {
.keys = paste0(
ifelse(names(by) != "", paste(names(by),by,sep="="),by),
collapse=","
collapse=", "
)
}
.count.lhs = nrow(x)
Expand Down Expand Up @@ -2165,7 +2178,8 @@ is_running_in_chunk = function() {
#' together in which case an attempt is made to determine which parts are
#' common.
#'
#' @param .data the tracked dataframes
#' @param .data the tracked dataframe(s) either as a single dataframe or as a
#' list of dataframes.
#' @param ... other params passed onto either `p_get_as_dot()`, notable ones are
#' `fill` (background colour e.g. 'lightgrey'), `fontsize` (in points),
#' `colour` (font colour)
Expand All @@ -2190,18 +2204,21 @@ is_running_in_chunk = function() {
#' tmp %>% group_by(Species) %>% comment(.tag="step2") %>% flowchart()
p_flowchart = function(.data, filename = NULL, size = std_size$half, maxWidth = size$width, maxHeight = size$height, formats=c("dot","png","pdf","svg"), defaultToHTML = TRUE, ...) {

if("trackr_df" %in% class(.data)) .data = list(.data)
# make sure .data is a list of dataframes
if(is.data.frame(.data)) .data = list(.data)
mergedGraph=.emptyGraph()

if(!any(sapply(.data, .isTracked))) stop("None of the inputs is a tracked data frame. Did you forget to call dtrackr::track()")
if(!all(sapply(.data, .isTracked))) rlang::warn("Some of the inputs are not tracked data frames. These will be ignored.", .frequency = "always")

for(item in .data) {
if ("trackr_df" %in% class(item)) {
mergedGraph = .mergeGraphs(mergedGraph, item %>% p_get())
} else {
rlang::warn(".data is not a tracked dataframe. Did you forget to call dtrackr::track()?", .frequency = "always")
}
}

# if we are knitting and the output is not HTML we will need the image
# saved somewhere as a png and pdf.Also if output if github markdown
# saved somewhere as a png and pdf. Also if output if github markdown
# Also if we are viewing the image in the console and the user requested the png
if(
(is_knitting() && !(knitr::is_html_output()))
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/consort-example.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/dtrackr-options.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/articles/dtrackr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/joining-pipelines.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 15 additions & 13 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ articles:
dtrackr-options: dtrackr-options.html
dtrackr: dtrackr.html
joining-pipelines: joining-pipelines.html
last_built: 2022-11-04T23:40Z
last_built: 2022-11-17T17:38Z

2 changes: 1 addition & 1 deletion docs/reference/add_count.trackr_df.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/add_tally.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/anti_join.trackr_df.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/arrange.trackr_df.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/bind_cols.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/bind_rows.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6d8865f

Please sign in to comment.