Why am I getting this error while trying to import

832 Views Asked by At

I'm just started using rio to import as have a .tsv file to work with. I'm having the error with multiple files that no such file exists however my working directory is set correctly and I have affirmed this using getwd(). I've done a search online and restarted etc but cannot see what the problem could be.

Working off R version 4.0.3 in RStudio. Is there something stupid I'm missing here?

library(rio) 
library(feather)

install_formats()

transcodeData <- import("Data\transcoding_mesurement.tsv")
2

There are 2 best solutions below

5
On

backward slash (\) is a special character in R. either escape \ by using two in a row or use forward slashes to delimit folders.

transcodeData <- import("Data\\transcoding_mesurement.tsv")
transcodeData <- import("Data/transcoding_mesurement.tsv")
0
On

Got working if I have data file in same folder as scripts with code below in case it helps anyone in future. Still can't get it to point outside of that folder successfully

rio::import("transcoding_mesurment.tsv", format = "tsv")