Skip to content

Commit

Permalink
use fread instead of read.table
Browse files Browse the repository at this point in the history
  • Loading branch information
tdhock committed Jan 5, 2024
1 parent 5138879 commit 065d89f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vignettes/v7-capture-glob.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ The code below defines a glob for matching several data files.

```{r}
db <- system.file("extdata/chip-seq-chunk-db", package="nc", mustWork=TRUE)
suffix <- if(interactive())"gz" else "head"
(glob <- paste0(db, "/*/*/counts/*", suffix))
(glob <- paste0(db, "/*/*/counts/*gz"))
(matched.files <- Sys.glob(glob))
```

Expand Down Expand Up @@ -122,7 +121,7 @@ We can absolutely use base R to read these files, but it takes a bit more code,
```{r}
base.df.list <- list()
for(file.csv in matched.files){
file.df <- read.table(file.csv, skip=1, col.names=c("chrom","start", "end", "count"))
file.df <- read.bedGraph(file.csv)
counts.path <- dirname(file.csv)
chunk.path <- dirname(counts.path)
data.path <- dirname(chunk.path)
Expand Down

0 comments on commit 065d89f

Please sign in to comment.