join_tabulated() and create_dataset()
gained a finer_add argument, controlling what happens when
an additional table is more finely grained than everything selected in
vars/tables (for example a session-level
vars_add on top of a participant-level selection). Such a
table cannot be attached without adding rows, which conflicts with
vars_add/tables_add never creating rows.
"error" (default): abort, naming the tables and both
ways out."first": keep one value per row and drop the rest, with
a warning reporting how many. The value kept is the first by the
additional table’s own identifier columns, i.e. the earliest
available session or run rather than a fixed baseline. The
whole row is taken, so all variables from that table come from the same
session/run and a missing value is not skipped in favor of a later one.
The finer identifier columns are not added to the result."all": keep every value and add rows. This is the
behavior of earlier versions.Selecting those variables via vars/tables
instead keeps every value without making a row ambiguous.
This is a breaking change. Selections that
previously expanded rows now raise an error by default; pass
finer_add = "all" to restore the old result, or
"first" for one row per main-row identifier
combination.
join_tabulated() returning missing or wrong
values when the selected variables come from tables with different
identifier columns. Two cases were affected, both silent:
vars_add/tables_add (such as demographic
information) were missing on most rows as soon as a session-level
additional variable was requested as well, and adding an unrelated
additional variable could change the values of another one. The
additional tables are no longer joined to each other before being added
to the data; each is now attached on its own identifier columns.join_tabulated() now fails with an informative error,
instead of silently duplicating rows, when an additional table has more
than one row per identifier combination.citation("NBDCtools") (new
inst/CITATION), the package startup message, the
package-level documentation, and the README.nbdctools,
which provides both a wrapper around the R package and a pure Python
implementation.utils package in
DESCRIPTION file.create_bids_sidecar_metadata() functioncheck_dd() function that caused an
error when using a release version. When trying to get
id_cols, the release number was not used in study-specific
way, which caused a search in both studies, and caused release not found
in the second study. Now the search is done in a study-specific
way.create_bids_sidecar_metadata() function to create
BIDS sidecar from metadata without using any processed datasets. The old
create_bids_sidecar() function is now renamed to
create_bids_sidecar_data().get_all_releases() and
get_latest_release() functions to retrieve information
about all data releases, the latest release, respectively.join_tabulated() that checks
if the specified release version is the same as the data version of
files in the dir_data directory. This is done by searching
for a special file by study that contains the correct session IDs for
that release. If this file is not found, users will get a warning
message and futher validation is skipped. If the file is found but the
session IDs do not match, an error is raised.add_custom_metadata() function to allow users to
add their own metadata to the NBDCtools environment. This is useful for
users who have their own metadata. A new vignette “Add custom metadata”
has been added to demonstrate how to use this function.NBDCtoolsData package, as
CRAN does not allow skipping checks. Now the
check_data_pkg_installed performs the check when other
functions are called.NBDCtoolsData is now loaded into a separate
environment as caching for faster access.NBDCtoolsData to Suggests in
DESCRIPTION file.is_on_cran() internal function.@examplesIf roxygen tag to avoid examples being
run on CRAN if NBDCtoolsData is not installed.transf_factor function that caused an error
when the data has no session_id column.transf_value_to_label() function
that led to the order of categorical levels being incorrect after
transformation to labels.join_tabulated() function that
occurred if the first table/variable in
tables_add/vars_add was static but further
tables/variables were dynamic.join_bys in join_tabulated() are now
dynamically set by intersecting with id_cols. Hardcoded
join_by has been removed.The initial release of the NBDCtools package.