watchme_combine_results: Combine objects with same pictures but different codes

Description Usage Arguments Details Value Examples

Description

Combine objects with same pictures but different codes

Usage

1
watchme_combine_results(results_list, common_codes = c("non codable"))

Arguments

results_list

a list of tibble created by watchme_prepare_data.

common_codes

One or several codes that are common between the objects.

Details

The motivation was to create a single object based on several coding files in the CHAI project: each pass/group of codes such as cooking and travel resulted in one file, and we want to combine them.

Forcommon_codes codes, the annotation are merged: if an image has such a code in an object and not in the other, the code is assigned to the image in the resulting object. The code does not look for conflicts.

Value

A tibble with

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
passes <- c("CK", "IO", "OP", "PM", "TP")

create_pass_results <- function(pass){
  path_results <- system.file('extdata', paste0("oneday_", pass, ".csv"),
  package = 'watchme')
  sep_results <- "\t"
  path_dico <-  system.file('extdata', paste0("dico_coding_2016_01_", pass, ".csv"),
   package = 'watchme')
  sep_dico <- ';'

  results <- watchme_prepare_data(path_results = path_results,
                                  sep_results = sep_results,
                                  path_dico = path_dico,
                                  sep_dico = sep_dico,
                                  tz = "Asia/Kolkata")
  results$image_path <- gsub('\"', "", results$image_path)
  results
}

results_list <- purrr::map(passes, create_pass_results)
oneday_results <- watchme_combine_results(results_list,
common_codes = "non_codable")
oneday_results

masalmon/watchme documentation built on May 21, 2019, 12:41 p.m.