cm_code.overlap(x2long.obj, overlap.code.list, rm.var = NULL)
cm_range2long
,
cm_time2long
or cm_df2long
.Returns a dataframe with co-occurrences of supplied overlapping codes added.
Combine co-occurrences of codes into a new code.
The code column must be named code and your start and end columns must
be named "start"
and "end"
.
## <strong>Not run</strong>: # foo <- list( # AA = qcv(terms="1:10"), # BB = qcv(terms="1:2, 3:10, 19"), # CC = qcv(terms="1:3, 5:6") # ) # # foo2 <- list( # AA = qcv(terms="4:8"), # BB = qcv(terms="1:4, 10:12"), # CC = qcv(terms="1, 11, 15:20"), # DD = qcv(terms="") # ) # # # (x <- cm_range2long(foo)) # (z <- cm_range2long(foo, foo2, v.name="time")) # cm_code.overlap(x, list(AB=qcv(AA, BB))) # cm_code.overlap(x, list(ALL=qcv(AA, BB, CC))) # combines <- list(AB=qcv(AA, BB), ABC=qcv(AA, BB, CC)) # (a <- cm_code.overlap(z, combines, "time")) # plot(a) # # #WITH cm_time2long # x <- list( # transcript_time_span = qcv(00:00 - 1:12:00), # A = qcv(terms = "2.40:3.00, 5.01, 6.02:7.00, 9.00"), # B = qcv(terms = "2.40, 3.01:3.02, 5.01, 6.02:7.00, 9.00, # 1.12.00:1.19.01"), # C = qcv(terms = "2.40:3.00, 5.01, 6.02:7.00, 9.00, 17.01") # ) # # y <- list( # transcript_time_span = qcv(00:00 - 1:12:00), # A = qcv(terms = "2.40:3.00, 5.01, 6.02:7.00, 9.00"), # B = qcv(terms = "2.40, 3.01:3.02, 5.01, 6.02:7.00, 9.00, # 1.12.00:1.19.01"), # C = qcv(terms = "2.40:3.00, 5.01, 6.02:7.00, 9.00, 17.01") # ) # # dat <- cm_time2long(x, y) # head(dat, 10) # out <- cm_code.overlap(dat, list(P=qcv(A, B), Q=qcv(B, C), R=qcv(A, B, C)), # rm.var="variable") # head(out, 10) # ## <strong>End(Not run)</strong>
cm_range2long
,
cm_time2long
,
cm_df2long
,
cm_code.combine
,
cm_code.transform