0

I have been trying to import a file that is supposed to be a vcf file onto R but I cannot open it. How should I import it as a text file? I have tried to do this...

setwd("C:/Users/trauzzgi.STAFF/OneDrive - Victoria University of Wellington - STAFF/Desktop/")
getwd()

load("paua_snps") 

but this is the error message I get.

Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection
In addition: Warning message:
In readChar(con, 5L, useBytes = TRUE) :
  cannot open compressed file 'paua_snps', probable reason 'No such file or directory'

I do not understand this, as the file is in the directory. Can anyone help me?

Thanks

Giulia

LadyG
  • 13
  • 3
  • 1
    `load` loads R objects that were previously stored (saved) with `save`. So unless `"paua_snps"` is such a file (e.g. an .rds or .RData file) that's not the right function to read a VCF file. As VCF files are plain text files with a tabular layout you can simply use `read.table`. Mind you, the error suggests that the file does not exist. So there seem to be multiple issues here. I'm closing this question for now and linking to a duplicate post. If this is a different issue, please provide more details. – Maurits Evers May 19 '21 at 04:26
  • 1
    Hi Maurits, thanks so much for your input. I did solve my issue in the end. Thanks – LadyG May 20 '21 at 10:04

0 Answers0