edcarp / genomics-r-intro

Intro to R and RStudio for Genomics, University of Edinburgh
https://edcarp.github.io/genomics-r-intro/
Other
1 stars 1 forks source link

Notable Issues with `readr` package and `read_csv()` due to no `curl` package. #8

Open FlicAnderson opened 3 years ago

FlicAnderson commented 3 years ago

In an RStudio notebook on Notable via EDINA, I'm loading readr via tidyverse.

From the R Console:

$ library(tidyverse)
── Attaching packages ───────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.0 ──
✓ ggplot2 3.3.2     ✓ purrr   0.3.3
✓ tibble  2.1.3     ✓ dplyr   0.8.5
✓ tidyr   1.0.2     ✓ stringr 1.4.0
✓ readr   1.3.1     ✓ forcats 0.5.0
── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag()    masks stats::lag()

This seems to show readr loads correctly.

I then run read_csv() on the the file link & get this message regarding curl, then R crashes & there's a workspace message box about possible loss of data.

$ variants <- readr::read_csv("https://ndownloader.figshare.com/files/14632895")
`curl` package not installed, falling back to using `url()`

If the file is already downloaded via wget https://ndownloader.figshare.com/files/14632895 -O combined_tidy_vcf.csv run in the Terminal tab, or downloaded locally then uploaded into the RStudio working directory as "combined_tidy_vcf.csv", then I can run read_csv() successfully in the Console tab, but only after specifying the package:

$ variants <- read_csv("combined_tidy_vcf.csv")
Error in read_csv("combined_tidy_vcf.csv") : 
  could not find function "read_csv"

$ variants <- readr::read_csv("combined_tidy_vcf.csv")
Parsed with column specification:
cols(
  .default = col_double(),
  sample_id = col_character(),
  CHROM = col_character(),
  ID = col_logical(),
  REF = col_character(),
  ALT = col_character(),
  FILTER = col_logical(),
  INDEL = col_logical(),
  ICB = col_logical(),
  HOB = col_logical(),
  DP4 = col_character(),
  Indiv = col_character(),
  gt_PL = col_number(),
  gt_GT_alleles = col_character()
)
See spec(...) for full column specifications.

It seems like curl is missing, but I'm not 100% on whether this is an RCurl package, or "shell" curl.