Recent Releases of diyar
diyar - v.0.5.0
Version 0.5.0
New features
- New option (
"semi") for thebatchedargument inlinks(). All matches are compared against the record-set in the next iteration. Therefore, the number of record-pairs increase exponentially as new matches are found. This means fewer record-pairs (memory usage) but a longer run time compared to the"no"option. Conversely, it leads to more record-pairs (memory usage) but a shorter run time compared to the"yes"option. - New argument (
batched) inepisodes() - New argument (
split) inepisodes(). Split the analysis inN-splits ofstrata. This leads to fewer record-pairs (and memory usage) but a longer run time. - New argument (
decode) inas.data.frame.pid(),as.data.frame.epid()andas.data.frame.pane() - New function -
episodes_af_shift(). A more vectorised approach toepisodes()based onepidm::group_time(). - New function -
links_wf_episodes(). Implantation ofepisodes()usinglinks().
Changes
- Optimised
episodes()andlinks(). Each iteration now uses less time and memory. link_idslot inpidobjects is now alist.links()- records with missing values in asub_criteriaare now skipped at the corresponding iteration.- Updated argument in
links()-recursive. This now takes any of three options[c("linked", "unlinked", "none")].[c("linked", "unlinked")]collectively were previously[TRUE], while["none"]was previously[FALSE]. as.epids()now callsmake_episodes().- The default value for the
windowargument inpartitions()is nowNULL as.data.frame()andas.data.list()now only creates elements/fields from non-empty fieldsidandgidslots innumber_lineobjects are nowinteger(0)by default.episode_group(),record_group()andrange_match_legacy()have been removed.["recurisve"]episodes fromepisodes()are now presented as["rolling"]episodes withreference_event = "all_records"i.eOld syntax ~ episodes(..., episode_type == "recursive")New syntax ~ episodes(..., episode_type == "rolling", reference_event = "all_records")
Bug fixes
- When
recursivewasTRUE,links()ended prematurely and therefore missed some matches. Resolved. recurrence_sub_criteriainepisodes()was not implemented correctly and lead to incorrect linkage result in some instances. Resolved.overlap_method()- logical tests recycled incorrectly. Resolved.check_linksargument - Option"g"implemented as option"l". Resolved.make_pairs_wf_source(). Created incorrect pairs. Resolved.case_sub_criteriaandrecurrence_sub_criteriainepisodes()led to incorrect results. Resolved.
- C++
Published by OlisaNsonwu over 2 years ago
diyar - 0.4.2
New features
- New argument in
merge_ids()-shrinkandexpand. - New S3 method for class ‘d_report’ -
plot. - New S3 method for class ‘sub_criteria’ -
format. - New function -
true(). Predefined logical test for use withsub_criteria(). - New function -
false(). Predefined logical test for use withsub_criteria(). - New argument in
links()-batched. Specify if all record pairs are created or compared at once ("no") or in batches ("yes"). - New argument in
links()-repeats_allowed. Specify if the record pairs with duplicate elements should be created. - New argument in
links()-permutations_allowed. Specify if permutations of the same record pair should be created. - New argument in
links()-ignore_same_source. Specify if record pairs from different datasets should be created. <!-- + New argument inlinks_wf_probabilistic()-return_weights. XXXXXX. --> - New argument in
eval_sub_criteria()-depth. First order of recursion. - New function -
sets()andmake_sets(). Create permutations of record sets.
Changes
-
links()- WhenshrinkisTRUE, records in a record group must meet every listed matchcriteriaandsub_criteria. For example, ifpid_criis 3, then the record must have met matched another on the first three match criteria. -
links()-pid@iterationnow tracks when a record was dealt with instead of when it was assigned to a record group. For example, a record can be closed (matched or not matched) at iteration 1 but assigned to a record group at iteration 5. -
make_pairs()-x.*andy.*values in the output are now swapped. -
sub_criteriacan now export any data created bymatch_func. To do this,match_funcmust export alist, where the first element is a logical object. See the example below.
``` r library(diyar) val <- rep(month.abb[1:5], 2); val
> [1] "Jan" "Feb" "Mar" "Apr" "May" "Jan" "Feb" "Mar" "Apr" "May"
matchandexport <- function(x, y){ output <- list(x == y, data.frame(xval = x, yval = y, ismatch = x == y)) return(output) } sub.cri.1 <- subcriteria( val, matchfuncs = list(match.export = matchand_export) )
format(sub.cri.1, show_levels = TRUE)
> logical_test-{
> Lv.0.1-match.export(Jan,Feb ...)
> }
evalsubcriteria(sub.cri.1)
> $logical_test
> [1] 1 0 0 0 0 1 0 0 0 0
>
> $mf.0.1
> xval yval is_match
> 1 Jan Jan TRUE
> 2 Feb Jan FALSE
> 3 Mar Jan FALSE
> 4 Apr Jan FALSE
> 5 May Jan FALSE
> 6 Jan Jan TRUE
> 7 Feb Jan FALSE
> 8 Mar Jan FALSE
> 9 Apr Jan FALSE
> 10 May Jan FALSE
```
-
linkscan now export any data created within asub_criteria. To do this, thesub_criteriamust be created as described above. See an example below
``` r val <- 1:5 diffoneandexport <- function(x, y){ diff <- x - y ismatch <- diff <= 1 output <- list(ismatch, data.frame(xval = x, yval = y, diff = diff, ismatch = ismatch)) return(output) } sub.cri.2 <- subcriteria( val, matchfuncs = list(diff.export = diffoneandexport) ) links( criteria = "placeholder", subcriteria = list("cr1" = sub.cri.2))
> $pid
> [1] "P.1 (CRI 001)" "P.1 (CRI 001)" "P.3 (CRI 001)" "P.3 (CRI 001)"
> [5] "P.5 (No hits)"
>
> $export
> $export$cri.1
> $export$cri.1$iteration.1
> $export$cri.1$iteration.1$mf.0.1
> xval yval diff is_match
> 1 5 1 4 FALSE
> 2 4 1 3 FALSE
> 3 3 1 2 FALSE
> 4 2 1 1 TRUE
> 5 1 1 0 TRUE
>
>
> $export$cri.1$iteration.2
> $export$cri.1$iteration.2$mf.0.1
> xval yval diff is_match
> 1 5 3 2 FALSE
> 2 4 3 1 TRUE
> 3 3 3 0 TRUE
>
>
> $export$cri.1$iteration.3
> $export$cri.1$iteration.3$mf.0.1
> xval yval diff is_match
> 1 5 5 0 TRUE
```
Bug fixes
-
summary.epid()- Incorrect count for ‘by episode type’. Resolved. -
episodes()- Incorrect results in some instances withskip_order. Resolved. -
make_ids()- Did not capture all records in that should be in a record-group when matches are recursive. Resolved. -
make_pairs()- Incorrect record-pairs in some instances. Resolved. -
eval_sub_criteria()- When output ofmatch_funcis length one, it’s not recycled. Resolved. -
reverse_number_line()- Incorrect results in some instances. Resolved. -
links()- Incorrectiteration(pidsslot) for non-matches. Resolved. -
links()andepisodes()- Timing for each iteration was incorrect. Resolved.
- C++
Published by OlisaNsonwu over 3 years ago
diyar - v.0.4.1
New features
New function - overlap_method_names(). Overlap methods for a
corresponding overlap method codes.
Changes
-
"chain"overlap method split into"x_chain_y"and"y_chain_x"."chain"will continue to be supported as a keyword for"x_chain_y" OR "y_chain_x"method -
"across"overlap method split into"x_across_y"and"y_across_x"."across"will continue to be supported as a keyword for"x_across_y" OR "y_across_x"methods -
"inbetween"overlap method split into"x_inbetween_y"and"y_inbetween_x"."inbetween"will continue to be supported as a keyword for"x_inbetween_y" OR "y_inbetween_x"methods - Optimised
overlaps(). - Changed overlap method codes. Please review any previously specified
codes with
overlap_method_names().
Bug fixes
-
make_batch_pairs()(internal) created invalid record pairs. Resolved.
- C++
Published by OlisaNsonwu over 4 years ago
diyar - v.0.4.0
New features
- New function -
reframe(). Modify the attributes of asub_criteriaobject. - New function -
link_records(). Record linkage by creating all record pairs as opposed to batches as withlink(). - New function -
make_pairs(). Create every combination of records-pairs for a given dataset. - New function -
make_pairs_wf_source(). Create records-pairs from different sources only. - New function -
make_ids(). Convert an edge list to a group identifier. - New function -
merge_ids(). Merge two group identifiers. - New function -
attrs(). Pass a set of attributes to one instance ofmatch_funcsorequal_funcs.
Changes
- Optimised
episodes_wf_splits() - Optimised
episodes()andlinks(). Reduced processing times. - Three new options for the
displayargument."progress_with_report","stats_with_report"and"none_with_report". Creates ad_report; a status of the analysis over its run time. -
eval_sub_criteria(). Record-pairs are no longer created in the function. Therefore,index_recordandsnarguments have been replaced withx_posandy_pos. -
link_records()andlinks_wf_probabilistic(). Thecmp_thresholdargument has been renamed toattr_threshold. -
show_labelsargument inschema(). Two new options -"wind_nm"and"length"to replace"length_label".
Bug fixes
- Incorrect
wind_idlist inepisodes()whendata_linkis used. Resolved. - Incorrect
link_idinlinks()whenrecursiveis used. Resolved. -
iterationnot recorded in some situations withepisodes(). Resolved. -
skip_orderends an open episode. Resolved. -
NAindist_wind_indexanddist_epid_indexwhensnis supplied. Resolved. -
overlap_method_codes()- overlap method codes not recycled properly. Resolved.
- C++
Published by OlisaNsonwu over 4 years ago
diyar - v.0.3.1
New features
- New function -
delink(). Unlink identifiers. - New function -
episodes_wf_splits(). Wrapper function ofepisodes()for better optimised handling of duplicates records. - New function -
combi(). Numeric codes for unique combination of vectors. - New function -
attr_eval(). Recursive evaluation of a function on each attribute of asub_criteria.
Changes
- Two new
case_nmvalues -Case_CRandRecurrence_CRwhich areCaseandRecurrencewithout a sub-criteria match.
Bug fixes
- Corrected length arrows in
schema.epid. - Corrected outcome of
eval_sub_criteriawith 1 result.
- C++
Published by OlisaNsonwu almost 5 years ago
diyar - v.0.3.0
New features
- New function -
links_wf_probabilistic(). Probabilistic record linkage. - New function -
partitions(). Spilt events into sections in time. - New function -
schema(). Plot schema diagrams forpid,epid,paneandnumber_lineobjects. - New functions -
encode()anddecode(). Encoding and decoding slots values to minimise memory usage. - New argument -
case_sub_criteriaandrecurrence_sub_criteriainepisodes(). Additional matching conditions for temporal links. - New argument -
case_length_totalandrecurrence_length_totalinepisodes(). Number of temporal links required for awindow/episode. - New argument -
recursiveinlinks(). Control if matches can spawn new matches. - New argument -
check_duplicatesinlinks(). Control the checking of logical tests on duplicate values. IfFALSE, results are recycled for the duplicates. as.data.frameandas.listfor thepid,number_line,epid,paneobjects.- A new type of episode - “recursive” episodes.
recurrence_from_lastrenamed toreference_eventand given two new options.- Optimised
episodes()andlinks(). Speed improvements.
Changes
- Default time zone for an
epid_intervalorpane_intervalwithPOSIXctobjects is now “GMT”. number_line_sequence()- splits number_line objects. Also available as aseqmethod.epid_total,pid_totalandpane_totalslots are populated by default. No need to usedgroup_statsto get these.to_df()- Removed. Useas.data.frame()instead.to_s4()- Now an internal function. It’s no longer exported.compress_number_line()- Now an internal function. It’s no longer exported. Useepisodes()instead.sub_criteria()- produces asub_criteriaobject. Nested “AND” and “OR” conditions are now possible.case_overlap_methods,recurrence_overlap_methodsandoverlap_methodsnow takeintegercodes for different combinations of overlap methods. Seeoverlap_methods$optionsfor the full list.characterinputs are still supported.
Bug fixes
"Single-record"was wrong inlinkssummary output. Resolved.
- C++
Published by OlisaNsonwu about 5 years ago
diyar - v.0.2.0
New features
- Better support for
Infinnumber_lineobjects. - Can now use multiple
case_lengthsorrecurrence_lengthsfor the same event.- Can now use multiple
overlap_methodsfor the correspondingcase_lengthsandrecurrence_lengths.
- Can now use multiple
- New function
links()to replacerecord_group(). - New function
sub_criteria(). The new way of supplying asub_criteriainlinks(). - New functions
exact_match(),range_match()andrange_match_legacy(). Predefined logical tests for use withsub_criteria(). User-defined tests can also be used. See?sub_criteria. - New function
custom_sort()for nested sorting. - New function
epid_lengths()to show the requiredcase_lengthorrecurrence_lengthfor an analyses. Useful in confirming the requiredcase_lengthorrecurrence_lengthfor episode tracking. - New function
epid_windows(). Shows the period adatewill overlap with given particularcase_lengthsorrecurrence_lengths. Useful in confirming the requiredcase_lengthorrecurrence_lengthfor episode tracking. - New argument -
stratainlinks(). Useful for stratified data linkage. As in stratified episode tracking, a record with a missingstrata(NA_character_) is skipped from data linkage. - New argument -
data_linksinlinks(). Unlink record groups that do not include records from certain data sources - New convenience functions
listr(). Formatatomicvectors as a written list.combns(). An extension ofcombnto generate permutations not ordinarily captured bycombn.
- New
iterationslot forpidandepidobjects - New
overlap_method-reverse()
Changes
number_line()-landrmust have the same length or be1.episodes()-case_nmdifferentiates between duplicates of"Case"("Duplicate_C") and"Recurrent"events ("Duplicate_R").- Strata and episode-level options for most arguments. This gives greater flexibility within the same instance of
episodes().- Episode-level - The behaviour for each episode is determined by the corresponding option for its index event (
"Case").episode_type- simultaneously track both"fixed"and"rolling"episodes.skip_if_b4_lengths- simultaneously track episodes where events before a cut-off range are both skipped and not skipped.episode_unit- simultaneously track episodes by different units of time.case_for_recurrence- simultaneously track"rolling"episodes with and without an additional case window for recurrent events.recurrence_from_last- simultaneously track"rolling"episodes with reference windows calculated from the first and last event of the previous window.
- Strata-level - The behaviour for each episode is determined by the corresponding option for its
strata. Options must be the same in each strata.from_last- simultaneously track episodes in both directions of time - past to present and present to past.episodes_max- simultaneously track different number of episodes within the dataset.
- Episode-level - The behaviour for each episode is determined by the corresponding option for its index event (
include_overlap_method-"overlap"and"none"will not be combined with other methods."overlap"- mutually inclusive with the other methods, so their inclusion is not necessary."none"- mutually exclusive and prioritised over the other methods (including"none"), so their inclusion is not necessary.
- Events can now have missing cut-off points (
NA_real_) or periods (number_line(NA_real_, NA_real_))case_lengthandrecurrence_length. This ensures that the event does not become an index case however, it can still be part of different episode. For reference, an event with a missingstrata(NA_character_) ensures that the event does not become an index case nor part of any episode.
Bug fixes
fixed_episodes,rolling_episodesandepisode_group-include_index_perioddidn't work in certain situations. Corrected.fixed_episodes,rolling_episodesandepisode_group-dist_from_windwas wrong in certain situations. Corrected.
- C++
Published by OlisaNsonwu almost 6 years ago
diyar - v0.1.0
New features
record_group()-strataargument. Perform record grouping separately within subsets of a dataset.overlap(),compress_number_line(),fixed_sepisodes(),rolling_episodes()andepisode_group()-overlap_methodsandmethodsarguments replacesoverlap_methodandmethodrespectively. Use different sets of methods within the same dataset when grouping episodes or collapsingnumber_lineobjects.overlap_methodandmethodonly permits 1 method per per dataset.epidobjects -win_nmslot. Shows the type of window each event belongs to i.e. case or recurrence windowepidobjects -win_idslot. Unique ID for each window. The ID is thesnof the reference event for each window- Format of
epidobjects updated to reflect this
- Format of
epidobjects -dist_from_windslot. Shows the duration of each event from its window's reference eventepidobjects -dist_from_epidslot. Shows the duration of each event from its episode's reference eventepisode_group()androlling_episodes()-recurrence_from_lastargument. Determine if reference events should be the first or last event from the previous window.episode_group()androlling_episodes()-case_for_recurrenceargument. Determine if recurrent events should have their own case windows or not.episode_group(),fixed_episodes()androlling_episodes()-data_linksargument. Ungroup episodes that do not include records from certaindata_source(s).episode_group(),fixed_episodes()androlling_episodes()-case_lengthandrecurrence_lengtharguments. You can now use a range (number_lineobject).episode_group(),fixed_episodes()androlling_episodes()-case_lengthandrecurrence_lengtharguments. You can now use a range (number_lineobject).episode_group(),fixed_episodes()androlling_episodes()-include_index_periodargument. IfTRUE, overlaps with the index event or period are groupped together even if they are outside the cut-off range (case_lengthorrecurrence_length).pidobjects -link_idslot. Shows the record (snslot) to which every record in the dataset has matched to.invert_number_line()- Invert theleftand/orrightpoints to the opposite end of the number lineleft_point(x)<-,right_point(x)<-,start_point(x)<-andend_point(x)<-accessor functions
Changes
overlap()renamed tooverlaps().overlap()is now a convenienceoverlap_methodfor ANY kind of overlap"none"is another convenienceoverlap_methodfor NO kind of overlapexpand_number_line()- new options forpoint;"left"and"right"compress_number_line()- compressednumber_lineobject inherits the direction of the widestnumber_lineamong overlapping group ofnumber_lineobjectsoverlap_methods- have been changed such that each pair ofnumber_lineobjects can only overlap in one way. E.g."chain"and"aligns_end"used to be possible but this is now considered a"chain"overlap only"aligns_start"and"aligns_end"use to be possible but this is now considered an"exact"overlap
number_line_sequence()- Output is now alist.number_line_sequence()- now works across multiplenumber_lineobjects.to_df()- can now changenumber_lineobjects to data.frames.to_s4()can do the reverse.
epidobjects are the default outputs forfixed_episodes(),rolling_episodes()andepisode_group()pidobjects are the default outputs forrecord_group()- In episode grouping, the
case_nmfor events that were skipped due torolls_maxorepisodes_maxis now"Skipped". - In
episode_group()andrecord_group(),sncan be negative numbers but must still be unique - Optimised
episode_group()andrecord_group(). Runs just a little bit faster ... - Relaxed the requirement for
xandyto have the same lengths in overlap functions.- The behaviour of overlap functions will now be the same as that of standard R logical tests
episode_group-case_lengthandrecurrence_lengtharguments. Now accepts negative numbers.- negative "lengths" will collapse two periods into one, if the second one is within some days before the
end_point()of the first period.- if the "lengths" are larger than the
number_line_width(), both will be collapsed if the second one is within some days (or any otherepisode_unit) before thestart_point()of the first period.
- if the "lengths" are larger than the
- negative "lengths" will collapse two periods into one, if the second one is within some days before the
- cheat sheet updated
- C++
Published by OlisaNsonwu about 6 years ago
diyar - v0.0.3
Changes
+ #7 episode_group(), fixed_episodes() and rolling_episodes() - optimized to take less time when working with large datasets
+ episode_group(), fixed_episodes() and rolling_episodes() - date argument now supports numeric values
+ compress_number_line() - the output (gid slot) is now a group identifier just like in epid objects (epid_interval)
- C++
Published by OlisaNsonwu over 6 years ago
diyar - v0.0.2
New feature - pid S4 object class for results of recordgroup(). This will replace the current default (data.frame) in the next major release - epid S4 object class for results of episodegroup(), fixedepisodes() and rollingepisodes(). This will replace the current default (data.frame) in the next release - tos4() and tos4 argument in recordgroup(), episodegroup(), fixedepisodes() and rollingepisodes(). Changes their output from a data.frame (current default) to epid or pid objects -todf() changes epid or pid objects to a data.frame deduplicate argument from fixedepisodes() and rollingepisodes() added to episodegroup()
Changes - fixedepisodes() and rollingepisodes() are now wrapper functions of episodegroup(). Functionality remains the same but now includes all arguments available to episodegroup() - Changed the output of fixedepisodes() and rollingepisodes() from numberline to data.frame, pending the change to epid objects pidcri column returned in recordgroup is now numeric. 0 indicates no match. columns can now be used as criteria multiple times recordgroup()
6 - numberline objects can now be used as a criteria in recordgroup()
Bug fixes
3 - Resolved a bug with episodeunit in episodegroup()
4 - Resolved a bug with bidirection in episodegroup()
- C++
Published by OlisaNsonwu over 6 years ago
diyar - v0.0.1
Version 0.0.1 Features fixedepisodes() and rollingepisodes() - Group records into fixed or rolling episodes of events or period of events. episodegroup() - A more comprehensive implementation of fixedepisodes() and rollingepisodes(), with additional features such as user defined case assignment. recordgroup() - Multistage deterministic linkage that addresses missing data. numberline S4 object. Used to represent a range of numeric values to match using recordgroup() Used to represent a period in time to be grouped using fixedepisodes(), rollingepisodes() and episodegroup() Used as the returned output of fixedepisodes() and rolling_episodes()
- C++
Published by OlisaNsonwu almost 7 years ago