analysis<-to a list, allowing all slide customizations from R.
Add several new
expressions that let you create derived variables in more flexible ways than was previously possible.
crunch::filter() now falls back to the next
filter on your searchpath when no method is defined.
tabBook()by default uses a new endpoint, which allows for more options. The old endpoint is deprecated, but while the server supports it, you can still use it. See
?tabBookfor more details.
filterobject when using
tabbook(). Filtering by expression in the dataset argument is also supported again.
deriveArray()using expressions to create the subvariables.
slideCategories()helps you create overlapping categorical variables (#396).
newSlideincludes examples of
vizTypesettings and other improvements.
copyFolders()function that copies folders and variable order from one dataset to another (similar to
copyOrder()which was deprecated)
filters(slide_object) <- NULLor
filters(slide_object) <- filter_object)
...removed from documentation
(un)hideVariables()functions are upgraded to use folder operations.
~, as in a
cd(projects(), "~")takes you there;
mv(projects(), ds, "~")moves
dsinto your personal folder.
listDatasets()now by default only prints datasets in your personal folder, not a combination of your personal datasets and some of the datasets that have been shared with you.
loadDataset(), it now searches to find datasets exactly matching that name unless you specify a project to load from. If you have multiple datasets with the same name in different locations,
loadDataset("your dataset name")may return a different one than it did previously. If you want to identify a dataset precisely in
loadDataset(), either specify the dataset URL (most effective but not as human friendly) or provide
project = "path/to/folder".
loadDataset(<integer>)no longer is supported.
is.public(multitables[[i]]) <- TRUEand several other similar assignments of attributes on an element of a catalog, which previously successfully updated the value on the server but errored when returning to R (#303, #367)
subvariables()on non-array variables returns
NULLinstead of an error (#237)
newExampleDataset()creates a sample dataset for you to explore
exportDeck()can now write to PowerPoint with
format = "pptx"
newDataset()now supports importing data in Triple-S format, providing a
schemafile in addition to the row data.
resolution()lets you see the data units of a datetime variable (“Y”, “M”, “D”, “ms”, etc.);
resolution<-lets you set it (#234)
deleteDataset()accepts web app URLs, just as
loadDataset()already did (#279)
options(crunch.warn.hidden=FALSE)to suppress the “Variable x is hidden” messages when accessing hidden variables (#172)
appendDataset()to allow datasets to be updated based on the primary-key variable; see
pk()for details on primary keys (#49)
combineResponses()are aliases for
combine(), providing a way to avoid accidental clashes with
makeArrayGadget()have been moved to the
crunchypackage. Wiring for them, including RStudio add-in configuration, remains here, but you’ll have to install that package to use them.
mv()and the other folder operations. These functions will be removed in December 2018.
makeWeight()is now correct for categorical variables with non-sequential IDs.
as.data.frame(force = TRUE)if requested.
index.table()to better reflect analysts’ intentions. Now,
index.table()calculates the index with respect to the marginal proportion of the
margingiven, so for
index.table(cube, 2)the column proportions of the table are indexed to the marginal row proportions. In other words: for each column how much larger or smaller is the proportion in that column when compared to the proportions for the row variable alone.
havenpackage and its new
mv()to move them to a folder.
deleteVariables()no longer tries to delete duplicate variables.
as.data.frame(..., force = TRUE)with numeric variables that have missing values.
Suggestsreference for test packages, following new
getDimTypes()returns a richer set of cube dimension types differentiating multiple response from categorical array dimensions.
changeCategoryID()tries to unset then reset the dataset exclusion if that impacts its progress. Best practice is to disable exclusions before running
changeCategoryID()if at all possible.
ordering<-of datasets within a project will now drop any invalid entries with a warning, rather than error.
streamRows()for case when sending only one row (#253).
getDimTypes()returns a richer set of cube dimension types differentiating multiple response from categorical array dimensions.
makeArrayGadget()launches an RStudio gadget to help you build valid categorical arrays and multiple response variables.
subtotals(var) <- NULLwhen it already was
""for variable metadata fields if no value is set (#232).
makeMRFromText()with a categorical variable.
crunch*packages can use it.
==on Crunch objects now follow R semantics more closely with regards to missing data.
rmdir(). These functions use a new API for variable folders (unlike the experimental versions of some that were introduced in the 1.19.0 package release). This API is currently in a beta testing phase. See
vignettes("variable-order", package="crunch")for examples and details.
ds$id_var_numeric <- as.Numeric(ds$id_var). There are
as.*methods for all Crunch data types except for array-like variables.
labelledclass when converting to Crunch variable types.
makeMRFromText()to take a variable imported as delimited strings, parse the multiple-response options, and return a (derived)
setPopulation(ds, size = 24.13e6, magnitude = 3)and for getting population sizes (or magnitudes) with
rollupResolution(ds$datetime)and set with
rollupResolution(ds$datetime) <- "M".
options(crunch.show.progress)to govern whether to report progress of long-running requests. Default is
TRUE, but set it to
FALSEto run quietly.
pollProgress()and recommend using that when a long-running request fails to complete within the local timeout.
subtotals(variable) <- Subtotal(name = 'subtotal', categories = c(1, 2), after = 2). Use
subtotals(variable)to see what subtotals are set for a variable.
vignette("subtotals", package="crunch")for more information.
as_selectedfunction instead of
selected_array, which is now deprecated).
options(crunch.mr.selection = "selected_array").
refresh()for Datasets is now more efficient.
ordering(ds)[[c("Top folder", "Nested folder")]]) or a single string with nested folders separated by a delimiter (as in
ordering(ds)[["Top folder/Nested folder"]]). “/” is the default path delimiter, and this is configurable via
options(crunch.delimiter). If you have folders that actually contain “/” in the folder name, this may be a breaking change. If so, set
options(crunch.delimiter="|")or some other string so that folder names are not incorrectly interpreted as paths.
mkdir()functions for creating variable folders and moving variables into them. These take a Dataset as their argument and can be chained together for convenience/readability.
folder<-to locate a variable in the folder hierarchy and to move it to a new folder.
folder(ds$var) <- "New folder/subfolder"is equivalent to
ds <- mv(ds, "var", c("New folder", "subfolder")).
collapseCategories()allows you to combine categories in place without creating a new variable
copy()has been made more efficient
CrunchDataFrameshave been improved to act more
data.frame-like. You can now access and overwrite values with standard
crdf$variable1 <- 1or
crdf[,"variable1"] <- 1.
CrunchDataFramesnow also support adding arbitrary columns, although it should be noted that these columns are not stored on the Crunch server, so if you want to keep that data outside of your current R session, you should send it back to your Dataset as a new variable.
is.selected()is now vectorized to work with Categories, as
is.na()has always been. You can also now assign into the function (#123)
addSubvariable()now accepts variable definitions directly (#72)
makeCaseVariable()has better errors when a user doesn’t name all of their case definitions (#158).
force = TRUEhas been removed (#150)
weightVariables(ds) <- ds$newWeightor
is.weightVariables(ds$var) <- TRUE
expropriateUser()to transfer datasets, projects, and other objects owned by one user to another, as when that user has left your organization.
UserCatalogsby email (e.g.
catalog[["email@example.com"]]) by default. All catalog extract methods (
[[) now also accept a
secondaryargument for setting an index to match against to change that default.
as_selectedmultiple-response variables have margin and prop.table methods
variables()now contain additional metadata, including “type”
bases()when called on a univariate statistic (#124)
makeWeight()allows you to generate new weighting variables based on categorical variables (#80).
cut(), equivalent to
base::cut, allows you to generate a derived categorical variable based on a numeric variable (#93).
newDataset()directly instead of
newDatasetFromFile. Also, you can now create a dataset from a hosted file passing its URL to
VariableCatalogfor a view of variable metadata (#75)
crunchBox()now allows you to specify colors for branding or even category-specific coloring.
login()in a way that conceals the input.
changeCategoryID()to only update numeric values of the category having its id changed when the id and the numeric value are the same.
appendDataset()has been deprecated. The option no longer has any effect and a warning will be printed to notify users about the deprecation.
geo()on a variable to see if there is already associated geographic data.
addGeoMetadata()function to match a text or categorical variable with available geodata based on the contents of the variable and metadata associated with Crunch-hosted geographic data.
derivation() <- NULL
copyOrder()to copy the ordering of variables from one dataset to another.
loadDataset()and it will now load the same dataset in your R session.
webApp()function to go the other way: open the dataset from your R session in your web browser.
categoriesFromLevels()is now exported (#77)
deleteSubvariable()by index instead deleted the parent variable
methodspackage so that
CrunchDataFrames with standard
Two attempts to fix download issues introduced by 1.17.4:
searchDatasets()to use the Crunch search API.
digits()(useful when exporting to SPSS files).
tablewhere a dimension is a
CrunchLogicalExprnow return a boolean dimension with names “FALSE” and “TRUE”, rather than the previous behavior of dropping the dimension and only returning the
makeCaseVariable()takes a sequence of case statements to derive a new variable based on the values from other variables.
interactVariables()takes two or more categorical variables and derives a new variable with the combination of each.
pendingStream(); append that pending stream data to the dataset with
multitables(ds)[["Multitable name"]] <- ~ var1 + var2syntax. Similarly, multitables can be deleted with
multitables(ds)[["Multitable name"]] <- NULL. Multitables also have new
toVariable()now accepts (and then strips) arguments of class
changeCategoryID()failed on multiple response variables.
dashboard<-methods to view and set a dashboard URL on a dataset
changeCategoryIDfunction to map categorical data to a new “id” and value in the data (#38, #47)
importMultitable()to copy a multitable form one dataset to another. Additionally,
Multitables now have a show method showing its name and column variables.
appendDataset()now truly appends a dataset and no longer upserts if there is a primary key set. This is accomplished by removing the primary key before appending. (#35)
pk(dataset)and set with
pk(dataset) <- variable.
inst/so that other packages that depend on
crunchcan use the same setup.
prop.tablecomputations line up with those not containing array variables (i.e. move subvariables to the third array dimension in the result).
CrunchCube(corresponding to variables of the dimensions in the cube),
MultitableResult(corresponding to the “column” variables of the cubes in the result), and
TabBookResult(corresponding to the “row”/“sheet” variables in each multitable result).
namesmethod for TabBookResults following an API change.
crtabsformula parsing to support multiple, potentially named, measures
weightVariablesmethod to display the set of variables designated as valid weights. (Works like
appendDataset, allow specifying a subset of rows to append (in addition to the already supported selection of variables)
loadDatasetcan now load a dataset by its URL.
?with_consentfor more details.
inst/so that other packages depending on this package can access them more easily.
is.derivedmethod for Variables
TabBookResults when the row variable is a categorical array
multitablesmethod to access catalog from a Dataset.
newMultitableto create one. See
?newMultitablefor docs and examples.
tabBookto compute a tab book with a multitable. If
format="json"(the default), returns a
CrunchCubeobjects with which further analysis or formatting can be done.
basesmethod for cubes and tab book responses to access unweighted counts and margin tables.
saveVersionwhen there are no changes since the last saved version.
newProjectfunctions to create those objects more directly, rather than by assigning into their respective catalogs.
with_consentas an alternative to
deletein favor of the
httptestfor mocking HTTP and the Crunch API.
embedCrunchBoxto generate embeddable HTML markup for CrunchBoxes
duplicatedmethod for Crunch variables and expressions
as.data.framemethods by smarter pagination of requests.
is.na<-to set missing values on a variable, equivalent to assigning
settings(ds)$weightand not just its
crunchBoxto make a public, embeddable analysis widget
settings<-to view and modify dataset-level controls, such as default “weight” and viewer permissions (“viewers_can_change_weight”, “viewers_can_export”)
flattenOrderto strip out nested groups from an order
sd, now respect filter expressions, as does the
loadDatasetfrom a nonexistent project.
appendDatasetcan now append a subset of variables
flipArraysfunction to generate derived views of array subvariables
appendDataset, defaulted to
TRUE, which ensures that a failed append leaves the dataset in a clean state.
allVariablesis now ordered by the variable catalog’s order, just as
variableshas always been.
crtabsthat allows crosstabbing a multiple-response variable as if it were a categorical array.
merge) a subset of variables and/or rows of a dataset.
moveToGroupfunction and setter for easier adding of variables to existing groups.
locateEntityfunction to find a variable or dataset within a potentially deeply nested order.
hiddenVariablesfrom “name” to “alias”, governed by
session()that lazily fetches catalogs rather than when instantiated.
as.vectoron a categorical-array or multiple-response variable now returns a
data.frame. While a
matrixis a more accurate representation of the data type, using
data.frameallows for more intuitive accessing of subvariables by
$, just as they are from the Crunch dataset.
joinDatasetswith its (new) default
addSubvariableto PATCH rather than unbind and rebind; also extend it to accept more than one (sub)variable to add to the array.
patternmatching argument from
hideVariables, deprecated since 1.9.6.
deleteSubvariableto follow model of
deleteVariable, including requiring consent to delete.
options(crunch.namekey.array="name")in your script or in your .Rprofile.
deleteSubvariablenow follows “crunch.namekey.array” and will take either subvariable names or aliases, depending on the value of the setting.
extendDatasetfunction, also aliased as
merge, to allow you to add columns from one dataset to another, joining on a key variable from each.
compareDatasetsnow checks the subvariable matching across array variables in the datasets to identify additional conflicts.
notes<-methods for datasets, variables, and variable catalogs to view and edit those new metadata fields.
NULL(i.e. when you reference a variable in a dataset using
$and the variable does not exist) returns a helpful message.
newDatasetwhen passing a
data.frameor similar that has spaces in the column names.
as.characterif you have a factor and want it to be imported as type Text.
cleanseBatchesfunction to remove batch records from failed append attempts. Remove deprecated code around batch conflict reporting.
projectsfunctions to get dataset and project catalogs. (
datasetspreviously existed only as a method for Project entities.)
loadDatasetsto facilitate viewing and loading datasets that belong to projects.
compareDatasetsthat shows how datasets will line up when appending. A
summarymethod on its return value prints a report that highlights areas of possible mismatch.
NULLassignment into Variable/DatasetGroups to remove elements
CrunchExpr, Variable, and Dataset objects
DatetimeVariableand a character vector, assumed to be ISO-8601 formatted.
permissionsmethod for Datasets to work directly with sharing privileges.
CrunchDatasetwhen a variable alias contained an apostrophe.
jsonliteAPI in its v0.9.22
exportDatasetto download a CSV or SAV file of a dataset.
write.csvconvenience method for CSV export.
icon<-methods for Projects to read the project’s current icon URL and to set a new icon by supplying a local file name to upload.
is.published(the inverse of
owner<-for datasets to read and modify the owner
is.editor<-for project MemberCatalog
mefunction to get the user entity for yourself
variableMetadatafunction to export all variable metadata associated with the dataset
patternargument for functions including
hideVariablesis being deprecated. The help pages for those functions advise you to grep for or otherwise identify your variables outside of these functions.
unshareto revoke access of a user or a team to a dataset.
type<-assignment is safe.
CrunchExprs) for greater reliability
session()or returned from
login(), containing the various catalog resources (Datasets, etc.).
loadDatasetwith a dataset catalog tuple, allowing some degree of tab completion by dataset name. (Example:
cr <- login(...); ds <- loadDataset(cr$datasets$My_Dataset_Name))
useAliasattribute of datasets and move it to a global option, “crunch.namekey.dataset”, defaulted to “alias”. Implement the same for array variables, “crunch.namekey.array”, and default to “name” for consistency with previous versions. This default will change in a future release.
CrunchExprto GET rather than POST.
forkDatasetto make a fork (copy) of a dataset;
mergeForkto merge changes from a fork back to its parent (or vice versa)
digestpackage (httpcache depends on it instead).
combinecategories of categorical and categorical-array variables, and responses of multiple-response variables, into new derived variables
endDateattributes and setters for dataset entities (#10, #11)
ncol(ds)by removing a server request
CrunchExpr): prints an R formula-like expression
name(ds$var$subvar) <- value
addSubvariablefunction to add to array and multiple response variables (#7)
dropRowsto permanently delete rows from a dataset.
NULLin cube dimension when referencing subvariable that does not exist (as when using alias instead of name) and return a useful message.
addVariablesfunction to add multiple variables to a dataset efficiently
CrunchExprs and filtered variables in
crtabswhen requesting a crosstab of three or more dimensions.
VarDef) function and class for creating variable definitions with more metadata (rather than assigning R vectors into a dataset and having to add metadata after).
makeMR, to return
VariableDefinitions rather than creating the new variables themselves. Creation happens on assignment into the dataset.
NAfor categoricals) even if No Data doesn’t already exist
copyof a variable. See
NULLinto a dataset when the referenced variable (alias) does not exist.
NAassignment into variables.
/batches/while waiting for an append to complete. Improves the performance of the append operation.
cmethod for Categories, plus support for creating and adding new categories to variables. See
as.vectorby specifying a “mode” of “id” or “numeric”, respectively. See
withstatements. Use it to give
consent()to delete things.
<- NULLinto a dataset (like removing a column from a data.frame). Requires consent. Also create
deleteVariable(s)functions that also return the dataset object. Use either method to prevent your dataset from getting out of sync with the server when you delete variables.
crtabsto allow you to crosstab array subvariables.
exclusionfilters on datasets to drop certain rows
(un)lockdatasets for editing when there are multiple editors
restoreVersionfor dataset versioning
httr1.0; remove dependency on
RCurlin favor of
duplicatesparameter, which is
FALSEby default, adding new Groups to an Order “moves” the variable references to the new Group, rather than creating copies. See the variable order vignette for more details.
sharefunction for sharing a dataset with other users.
Add query cache, on by default.
as.data.frame now does not return an actual
data.frame unless given the argument
force=TRUE. Instead, it returns a
CrunchDataFrame, and environment containing unevaluated promises. This allows R functions, particularly those of the form
function(formula, data) to work with CrunchDatasets without copying the entire dataset from the server to local memory. Only the variables referenced in the formula fetch data when their promises evaluated.
RJSONIO dependency in favor of
crunch. Update all docs to reflect that. Make amendments to pass CRAN checks.
newDataset2 renamed to
newDatasetByCSV and made to be the default strategy in
newDataset. The old
newDataset has been moved to
getCube is now
crtabs. Ready for more extensive beta testing. Has prop.table and margin.table methods. Vignette forthcoming.
newDataset2 that uses the CSV+JSON import method, rather than the columm-by-column strategy that