Error(s) in re-building vignettes:
--- re-building ‘RedCAP.Rmd’ using rmarkdown
--- finished re-building ‘RedCAP.Rmd’

--- re-building ‘test_analysis.Rmd’ using rmarkdown
2026-08-07 16:31:03.613 R[61057:418567] XType: Using static font registry.
--- finished re-building ‘test_analysis.Rmd’

--- re-building ‘wrictools.Rmd’ using rmarkdown
preprocess_wric_file         package:wrictools         R Documentation

_P_r_e_p_r_o_c_e_s_s_e_s _a _w_r_i_c _d_a_t_a _f_i_l_e, _e_x_t_r_a_c_t_i_n_g _m_e_t_a_d_a_t_a, _c_r_e_a_t_i_n_g
_D_a_t_a_F_r_a_m_e_s, _a_n_d _o_p_t_i_o_n_a_l_l_y _s_a_v_i_n_g _r_e_s_u_l_t_s.

_D_e_s_c_r_i_p_t_i_o_n:

     Preprocesses a wric data file, extracting metadata, creating
     DataFrames, and optionally saving results.

_U_s_a_g_e:

     preprocess_wric_file(
       filepath,
       code = "id",
       manual = NULL,
       save_csv = FALSE,
       path_to_save = NULL,
       combine = TRUE,
       method = "mean",
       start = NULL,
       end = NULL,
       notefilepath = NULL,
       keywords_dict = NULL,
       entry_exit_dict = NULL
     )
     
_A_r_g_u_m_e_n_t_s:

filepath: Path to the wric .txt file.

    code: Method for generating subject IDs ("id", "id+comment",
          "study+id" (only for software v2), or "manual").

  manual: Custom codes for subjects in Room 1 and Room 2 if 'code' is
          "manual".

save_csv: Logical, whether to save extracted metadata and data to CSV
          files.

path_to_save: Directory path for saving CSV files, NULL uses the
          current directory.

 combine: Logical, whether to combine S1 and S2 measurements.

  method: Method for combining measurements ("mean", "median", "s1",
          "s2", "min", "max").

   start: character or POSIXct or NULL, rows before this will be
          removed, if NULL takes first row e.g "2023-11-13 11:43:00"

     end: character or POSIXct or NULL, rows after this will be
          removed, if NULL takes last row e.g "2023-11-13 11:43:00"

notefilepath: String, Directory path of the corresponding note file
          (.txt)

keywords_dict: List, A dictionary of keywords used to extract protocol
          events from a note file. Each entry should be a named list
          with:

          keywords A character vector of keywords or phrases to match
              in the note comment. Matching is case-insensitive.

          value Numeric protocol value to assign when the keyword is
              detected.

          type Optional character, either "instant" or omitted.
              "instant" events are applied at the specified timestamp
              and revert to the previous protocol immediately after.
              Non-instant events set the protocol until another event
              occurs.

          Behavior rules:

          Non-instant events Set the protocol value from their
              timestamp until another event overwrites it or until a
              stop keyword sets it to 0.

          Instant events Apply only at the timestamp of the note line,
              then revert to the protocol that was active immediately
              before.

          Stop keywords Always set the protocol to 0, regardless of
              previous state, unless overridden by an instant event.

          If 'NULL', a default set of keywords is used.

entry_exit_dict: Nested List, used to extract entry/exit times from
          note file

_V_a_l_u_e:

     list A list with the following components:

     version Character string indicating the detected software version
          ('"1"' for old software, '"2"' for new software).

     metadata A named list containing extracted metadata. For version
          1, this includes 'r1' and 'r2'. For version 2, this contains
          a single 'metadata' entry.

     dfs A named list containing processed data frames. For version 1:
          'room1' and 'room2'. For version 2: 'data'.

_E_x_a_m_p_l_e_s:

     outdir <- file.path(tempdir(), "wrictools")
     dir.create(outdir, showWarnings = FALSE)
     data_txt <- system.file("extdata", "data.txt", package = "wrictools")
     result <- preprocess_wric_file(data_txt, path_to_save = outdir)
     unlink(outdir, recursive = TRUE)
     


Quitting from wrictools.Rmd:312-319 [unnamed-chunk-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `dinner_index:(dinner_index + 14)`:
! NA/NaN argument
---
Backtrace:
    ▆
 1. ├─data[dinner_index:(dinner_index + 14), ]
 2. └─base::`[.data.frame`(...)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'wrictools.Rmd' failed with diagnostics:
NA/NaN argument
--- failed re-building ‘wrictools.Rmd’

SUMMARY: processing the following file failed:
  ‘wrictools.Rmd’

Error: Vignette re-building failed.
Execution halted