jsplyr 0.1.0
Initial CRAN release.
Core interface:
- Added a
dplyrinterface for manipulating data in JavaScript withtbl(),copy_to(),collect(),compute(), andshow_query(). - Added a promise-based
collect()decoupled fromshiny’s reactive input system.compute()usessession$registerDataObj()to create a session-scoped HTTP callback; the JS sidePOSTs the result to it, resolving a promise.collect()does not require a reactive context. - Embedded
compute()withincollect()so it runs automatically when not called earlier in the pipeline. - Re-exported the promise pipe operators
%...>%,%...!%, and%...T>%frompromises, socollect()results can be consumed in reactive contexts without attachingpromises.
Verbs:
- Added the
filter()verb to subset rows by predicate expressions, evaluated client-side. Comparisons (==,>,<, etc.) combined with&/|are supported. Values referenced frominputor the calling environment are resolved on the R side; column references are evaluated in the browser. - Added the
select()verb to choose columns by name. - Added the
distinct()verb to keep unique rows. When columns are supplied in...only those determine uniqueness and the first row per unique combination is kept; with no columns all columns are used. Supports.keep_allto retain all columns in the output. - Added the
mutate()verb for adding or modifying columns using expressions. Supports both non-standard evaluation and character string inputs. - Added
ifelse()support inmutate()expressions, translated to JavaScript ternary operators. Nestedifelse()calls are supported. - Added
if_else()as an alias forifelse()inmutate()expressions; both translate to JavaScript ternary operators. - Added
case_when()support inmutate()expressions, translated to chained JavaScript ternary operators. Clauses without aTRUE ~ ...catch-all yieldnullfor unmatched rows, matchingdplyr’sNAdefault. - Added
group_by()andsummarise()verbs with support formean(),sum(),min(),max(),n(),sd(), andmedian()aggregation functions. - Added join verbs
left_join(),right_join(),inner_join(),full_join(),semi_join(), andanti_join(). Joining twotbl_lazy_jsontables is performed in the browser. Supportsbyas a natural join (default), a shared key, or a named vector for differing key names. Colliding non-key columns get.x/.ysuffixes. - Added
is.na(),between(), andacross()/if_all()/if_any()support infilter()expressions.is.na()andbetween()are translated to JavaScript on the browser side, whileacross()/if_all()/if_any()are expanded over the selected columns (combined with&foracross()/if_all()and|forif_any()). Column selections acceptc(...), a bare column, a character vector, andall_of()/any_of(). - Added
across()support tomutate()andsummarise(), andall_of()/any_of()/across()column resolution togroup_by().across()is expanded on the R side over the selected columns and accepts a single function, a formula lambda (~ .x * 2), or a named list of functions, with optional.namesglue ({.col}/{.fn}).if_any()/if_all()remainfilter()-only. - Added
ungroup()to remove grouping set bygroup_by(). With no arguments all grouping is dropped; supplying column names removes only those columns from the grouping set (partial ungroup), matchingdplyr::ungroup(). - Added
arrange()to sort rows client-side by one or more columns. Wrap a column indesc()for descending order; multiple keys break ties left to right and the sort is stable.NA/nullvalues sort last. - Added
rename()to rename columns withnew = oldpairs, preserving column order. - Added the
slice()family:slice()(integer positions, negative positions drop rows),slice_head()/slice_tail()(first/lastnorprop), andslice_min()/slice_max()(rows with the smallest/largest values of a column). Slicing is group-aware when the data is grouped withgroup_by(). - Added
pull()to extract a single column as a vector. Likecollect(), it returns apromises::promise()resolving to the vector. Supports selection by name and by position, including negative indices counting from the last column. - Added
count()andtally().count()groups by the given columns and counts rows per group;tally()counts within an existinggroup_by(). Both honour thename(default"n") andsortarguments and reuse thegroup_by()/summarise()machinery. - Added
relocate()to reorder columns using.before/.afterplacement, defaulting to moving the selected columns to the front. - Added a
print()method fortbl_lazy_jsonthat shows the JSON source, a lazy (not-yet-computed) status, and the pending pipeline rendered asdplyr-like calls. Mirrorsdbplyr’s lazytblprint, without retrieving data from the browser.
Documentation:
- Added a
vignette("collect-with-promises")covering how to handlecollect()promises insidereactive(),eventReactive(),observeEvent()andobserve(). - Added example apps under
inst/example_apps/showcasingjsplyrusage, includingapp_showcase.Randapp_update_select.R.
CI/CD:
- Added GitHub Actions workflows for linting (
lintr::lint_package()), a standalonetestthatrun for fast PR feedback, test coverage reporting viacovrwith Codecov upload, and a version-bump check that fails PRs which do not bump theDESCRIPTIONVersion. - Added a
pkgdownworkflow that builds the documentation site and deploys it to GitHub Pages. - Added R-CMD-check, Lint, Codecov, and CRAN downloads badges to the README.
