mv()to move them to a folder.
deleteVariables()no longer tries to delete duplicate varaibles.
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 a an RStudio 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[["firstname.lastname@example.org"]]) 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
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.
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
Support for NA and NaN in
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