Skip to content

Instantly share code, notes, and snippets.

@ha0ye ha0ye/script.R
Created Feb 18, 2020

Embed
What would you like to do?
read in param output from text file
full_text <- readLines(file, warn = FALSE)
start_par_line <- grep("^\\$par", full_text)
start_objective_line <- grep("^\\$objective", full_text)
param_lines <- seq(from = start_par_line,
to = start_objective_line - 3,
by = 2)
params <- purrr::map_dfc(param_lines, function(line_idx)
{
readr::read_delim(file, delim = " ",
skip = line_idx, n_max = 1,
trim_ws = TRUE)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.