From 5fe1b3aeceaf662bd8476912211c6fc9e436e482 Mon Sep 17 00:00:00 2001 From: Martin Petr Date: Wed, 8 May 2024 19:12:36 +0200 Subject: [PATCH] Replace deprecated read_table2 with read_table --- R/io.R | 2 +- tests/testthat/helper-functions.R | 2 +- tests/testthat/test-io.R | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/io.R b/R/io.R index 9e8e6b9..c576e4f 100644 --- a/R/io.R +++ b/R/io.R @@ -21,7 +21,7 @@ read_ind <- function(data) { #' #' @export read_snp <- function(data, exclude = FALSE) { - readr::read_table2( + readr::read_table( ifelse(exclude, data$exclude, data$snp), col_names = c("id", "chrom", "gen", "pos", "ref", "alt"), col_types = "ccdicc", diff --git a/tests/testthat/helper-functions.R b/tests/testthat/helper-functions.R index 2c1fb84..45b9174 100644 --- a/tests/testthat/helper-functions.R +++ b/tests/testthat/helper-functions.R @@ -8,7 +8,7 @@ read_pops <- function(filename, columns) { } read_snp_file <- function(path) { - readr::read_table2( + readr::read_table( path, col_types = "ccdicc", col_names = c("id", "chrom", "gen", "pos", "ref", "alt") diff --git a/tests/testthat/test-io.R b/tests/testthat/test-io.R index d6b8cf9..3f12b82 100644 --- a/tests/testthat/test-io.R +++ b/tests/testthat/test-io.R @@ -46,7 +46,7 @@ test_that("read_snp and write_snp are inverse functions", { new_file <- tempfile() write_snp(true, new_file) - new <- readr::read_table2( + new <- readr::read_table( new_file, col_types = "ccdicc", col_names = c("id", "chrom", "gen", "pos", "ref", "alt")