-
Notifications
You must be signed in to change notification settings - Fork 289
Expand file tree
/
Copy pathread_log.R
More file actions
33 lines (33 loc) · 829 Bytes
/
read_log.R
File metadata and controls
33 lines (33 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#' Read common/combined log file into a tibble
#'
#' This is a fairly standard format for log files - it uses both quotes
#' and square brackets for quoting, and there may be literal quotes embedded
#' in a quoted string. The dash, "-", is used for missing values.
#'
#' @inheritParams datasource
#' @inheritParams read_delim
#' @export
#' @examples
#' read_log(readr_example("example.log"))
read_log <- function(
file,
col_names = FALSE,
col_types = NULL,
trim_ws = TRUE,
skip = 0,
n_max = Inf,
show_col_types = should_show_types(),
progress = show_progress()
) {
tokenizer <- tokenizer_log(trim_ws = trim_ws)
read_delimited(
file,
tokenizer,
col_names = col_names,
col_types = col_types,
skip = skip,
n_max = n_max,
progress = progress,
show_col_types = show_col_types
)
}