Skip to content

Commit 752ae62

Browse files
committed
change function to read from text file (back to built-in function, remove readr dependency)
1 parent f1bcd75 commit 752ae62

4 files changed

Lines changed: 2 additions & 7 deletions

File tree

R-pkg/DESCRIPTION

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ Imports:
6262
markdown,
6363
mime,
6464
parallel, pbapply, processx,
65-
readr,
6665
rlang,
6766
shiny,
6867
shinybusy (>= 0.2.2),

R-pkg/NAMESPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ importFrom(parallel,makeCluster)
6060
importFrom(parallel,stopCluster)
6161
importFrom(pbapply,pblapply)
6262
importFrom(processx,process)
63-
importFrom(readr,read_file)
6463
importFrom(rlang,duplicate)
6564
importFrom(shinyFeedback,feedbackWarning)
6665
importFrom(shinyFeedback,useShinyFeedback)

R-pkg/R/41_input_read.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#' @param file_name string, (server-side) path to a headersim file.
77
#' @param file_type string, MIME file type.
88
#' @param locus_type string, "snp" or "mss"
9-
#' @importFrom readr read_file
109
read_header <- function(file_name, file_type, locus_type = "snp") {
1110

1211
# init output
@@ -47,8 +46,7 @@ read_header <- function(file_name, file_type, locus_type = "snp") {
4746
out$header_file <- basename(file_name)
4847

4948
## HEADER FILE CONTENT
50-
# read whole file in one string and split it by new line
51-
header <- unlist(str_split(read_file(file_name), "\n"))
49+
header <- readLines(file_name, warn = FALSE)
5250

5351
## data file
5452
out$data_file <- header[1]

R-pkg/R/43_data_read.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,6 @@ check_snp_poolseq <- function(content, mrc = 1) {
829829
#' @param expected_data_file string, expected data file name for
830830
#' existing project, default is NULL.
831831
#' @importFrom tools file_ext
832-
#' @importFrom readr read_file
833832
read_mss_data <- function(data_file, data_dir) {
834833

835834
# init output
@@ -906,7 +905,7 @@ read_mss_data <- function(data_file, data_dir) {
906905
out$sex_ratio <- str_extract(header1, pttrn)
907906

908907
## FILE CONTENT
909-
file_content <- unlist(str_split(read_file(file_name), "\n"))
908+
file_content <- readLines(file_name, warn = FALSE)
910909

911910
## LOCUS DESCRIPTION (between second line and first 'POP/pop' keyword)
912911

0 commit comments

Comments
 (0)