File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -203,9 +203,14 @@ read_cmdstan_csv <- function(files,
203
203
} else if (metadata $ method == " optimize" ) {
204
204
all_draws <- 1
205
205
}
206
+ if (os_is_windows()) {
207
+ fread_cmd <- paste0(" findstr /b /v '#' " , output_file )
208
+ } else {
209
+ fread_cmd <- paste0(" grep -v '^#' " , output_file )
210
+ }
206
211
suppressWarnings(
207
212
draws <- data.table :: fread(
208
- cmd = paste0( " grep -v '^#' " , output_file ) ,
213
+ cmd = fread_cmd ,
209
214
select = col_select
210
215
)
211
216
)
@@ -380,9 +385,14 @@ read_csv_metadata <- function(csv_file) {
380
385
csv_file_info <- list ()
381
386
inv_metric_rows <- 0
382
387
parsing_done <- FALSE
388
+ if (os_is_windows()) {
389
+ fread_cmd <- paste0(" findstr /b /v '[#a-zA-Z]' " , output_file )
390
+ } else {
391
+ fread_cmd <- paste0(" grep -v '^#' " , output_file )
392
+ }
383
393
suppressWarnings(
384
394
metadata <- data.table :: fread(
385
- cmd = paste0( " grep '^[#a-zA-Z]' " , csv_file ) ,
395
+ cmd = fread_cmd ,
386
396
colClasses = " character" ,
387
397
stringsAsFactors = FALSE ,
388
398
fill = TRUE ,
You can’t perform that action at this time.
0 commit comments