New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
length of NULL cannot be changed
using readr::read_tsv (readr v1.1.1)
#750
Comments
to provide more feedback, I tried to reproduce this on my computer. No warning. I did not test it on R reprex::reprex_info()
#> Created by the reprex package v0.1.1.9000 on 2017-11-26
# Download the file in temp folder
url <- "https://github.com/tidyverse/readr/files/1503502/defuse_833ke_results.filtered.tsv.tar.gz"
tmp_file <- tempfile()
download.file(url, tmp_file)
tmp_dir <- tempfile("untar-dir-")
untar(tmp_file, list = T)
#> [1] "defuse_833ke_results.filtered.tsv"
untar(tmp_file, exdir = tmp_dir)
file_name <- list.files(tmp_dir)
path_to_file <- file.path(tmp_dir, file_name)
# Define col types
col_types_defuse = readr::cols_only(
"cluster_id" = readr::col_character(),
"splitr_sequence" = readr::col_character(),
"splitr_count" = readr::col_integer(),
"gene1" = readr::col_character(),
"gene2" = readr::col_character(),
"gene_chromosome1" = readr::col_character(),
"gene_chromosome2" = readr::col_character(),
"gene_name1" = readr::col_character(),
"gene_name2" = readr::col_character(),
"gene_strand1" = readr::col_character(),
"gene_strand2" = readr::col_character(),
"genomic_break_pos1" = readr::col_integer(),
"genomic_break_pos2" = readr::col_integer(),
"span_count" = readr::col_integer(),
"orf" = readr::col_character(),
"probability" = readr::col_number()
)
# read the file with custom col type
readr::read_tsv(
file = path_to_file,
col_types = col_types_defuse
)
#> # A tibble: 17 x 16
#> cluster_id
#> <chr>
#> 1 5267
#> 2 12586
#> 3 58
#> 4 2406
#> 5 8264
#> 6 3085
#> 7 2416
#> 8 11901
#> 9 2546
#> 10 8250
#> 11 11758
#> 12 9493
#> 13 8958
#> 14 2374
#> 15 11759
#> 16 11946
#> 17 15540
#> # ... with 15 more variables: splitr_sequence <chr>, splitr_count <int>,
#> # gene1 <chr>, gene2 <chr>, gene_chromosome1 <chr>,
#> # gene_chromosome2 <chr>, gene_name1 <chr>, gene_name2 <chr>,
#> # gene_strand1 <chr>, gene_strand2 <chr>, genomic_break_pos1 <int>,
#> # genomic_break_pos2 <int>, orf <chr>, span_count <int>,
#> # probability <dbl>
# delete tmp file
unlink(tmp_dir, recursive = T)
unlink(tmp_file) Thanks for providing the file. |
Thank you for replying. It works without issue on R 3.4.2 for me as well. |
To make it a bit easier to reproduce I created a docker image. Dockerfile:
script.R:
Building the image (
I've added the dockerfile, the script and the .tsv file in readr-error.tar.gz. Changing the dockerfile from saying |
Using the current devel version of readr ddbb5f4 and R-devel r73889 I am able to run the code in a So either a change in R or a change in the package seems to have fixed this. |
A rerun of that dockerfile reproduced the warnings (I made sure to delete all my local containers and images before rebuilding), so I guess I'm not getting the latest version of readr ( |
I believe Jim is referring to the dev. version of readr which you can install using: # install.packages("devtools")
devtools::install_github("tidyverse/readr") |
Now I tried installing it from github with the same error, though. This is the Dockerfile:
Building that with
Since I now installed readr from github and made sure I pulled the latest rstudio/rocker image, I shoouuld have the latest of both, right? |
Could you try building the Dockerfile I posted above, @jimhester? I'm still seeing this issue. |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
This leads to a lot of warning messages:
Is there something I'm doing wrong? I'm doing this from the
rocker/rstudio:devel
docker image.defuse_833ke_results.filtered.tsv.tar.gz
The text was updated successfully, but these errors were encountered: