0
votes

I am trying to open a dataset saved as a csv on Jupyter Notebook. I saved the dataset on my desktop:

data <- read.csv("⁨⁨Desktop/dataset1.csv")

I am getting the following error:

Warning message in file(file, "rt"): “cannot open file '"⁨⁨Desktop/dataset1.csv": No such file or directory” Error in file(file, "rt"): cannot open the connection Traceback:

  1. read.csv("\u2068/Desktop\u2069/dataset1.csv")
  2. read.table(file = file, header = header, sep = sep, quote = quote, . dec = dec, fill = fill, comment.char = comment.char, ...)
  3. file(file, "rt")

Can anyone understands what is going on? I am learning how to use Jupyter Notebook and I cannot find an answer online.

2
The Jupyter notebook does not know where your Desktop is. Try uploading the file to the Jupyter notebook environment.Andrew Chisholm
Provide the full directory like "C:/Users/.../Desktop/dataset1.csv"Bappa Das

2 Answers

0
votes

There's another way to read file using relative path:

setwd() : set working directory

getwd() : get working directory

if you put your file in desktop,it will be like this:

    setwd("C:/User/user/dektop") 
    a <- read.csv("filename.csv")
0
votes

Upload the file as in the red highlight in this screenshot. The uploaded file will then be local to any notebooks created in the same folder.

enter image description here

So your code would be

read.csv("yourfile.csv")