• Register
0 votes
328 views

Problem :

I am very new to the R, and after researching my error as below extensively, I am still unable to find the fix for it. I have already checked my working directory, and also made sure that the files are in a correct directory.

Error in file(file, "rt") : cannot open the connection file(file, "rt") read.table(file = file, header = header, sep = sep, quote = quote,dec = dec, fill = fill, comment.char = comment.char, ...)
read.csv(specdatapaths[i], header = T, sep = ",")pollutantmean3("specdata", "sulfate", 1:10)
In addition: Warning message:
In file(file, "rt") : cannot open file './specdata001.csv': No such file or directory

 

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I had spent a lot of time in recent past trying to understand what was actually wrong with my code.

And it seems to be very simple if you are using windows.

When you name the file "xyz.txt" then your windows name it as "xyz.txt.txt"... That will be the same with .CSV files as well so windows create the file named "007.csv.csv" if you called it "007.csv"

So, whenever you try to create your .csv file, you just rename it as"007" and open it in the R using below command :

read.table("/absolute/path/of/directory/with/required/007.csv")

 It will work for you as it works for me.

9 7 4
38,600 points

Related questions

0 votes
2 answers 1.4K views
1.4K views
Problem : I have the RScript file (let's call it main.r) which has the reference to another file, using the following code: source("functions.R") But, when i run a RScript file, it complains with the following error: Error in file(filename, "r", encoding = encoding) ... next to the functions.R in a same directory. I can call a functions.R in a RMd (RMarkdown) file which exist in a same directory
asked Jan 17, 2020 jwilliam 3.9k points
1 vote
2 answers 785 views
785 views
Problem : I am getting following error while trying to read the CSV file with R. in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : eof within quoted string
asked Nov 11, 2019 peterlaw 6.9k points
0 votes
1 answer 115 views
115 views
Problem : I am very new to tensorflow-gpu, I want to use the tensorflow-gpu on my system. I have already tried to reinstall tensorflow-gpu many times but still it shows me the following error.If I use the tensorflow-cpu then it works correctly. Please Note: I ... ) ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory Can somebody help me in fixing above error ?
asked Feb 19, 2020 mphil 2.3k points
0 votes
2 answers 86 views
86 views
Problem : I have recently installed the cuda 8.0 and cuda 9.0 in the Gpu support system. I encountered the below error while importing from the keras module. It says it is unable to load the native tensorflow runtime. I have received the error log as below: Traceback ... is, Cuda compilation tools, release 8.0, V8.0.61 Is it the clash between two cuda versions? Have anyone solved this before?
asked Feb 18, 2020 mphil 2.3k points
0 votes
1 answer 2.5K views
2.5K views
Problem : Following is my issue: I tried to install mysqlclient like below : C:\Users\alecxe>pip install mysqlclient Collecting mysqlclient Using cached https://files.pythonhosted.org/packages/ec/fd/83329b9d3e14f7344d1 cb31f128e6dbba70c5975c9e57896815dbb1988ad/mysqlclient-1.3.13.tar.gz Installed ... beginner to this and would be very happy if any input as to how to go about fixing above error.
asked Dec 27, 2019 alecxe 7.5k points
0 votes
1 answer 1.9K views
1.9K views
Problem : The import matplotlib.pyplot as plt is is giving me the error with python2.7, anaconda3. The error shown is as below: ImportError: libGL.so.1: cannot open shared object file: No such file or directory The Detailed Error report is as below : Traceback ... <module> from PyQt5 import QtCore, QtGui, QtWidgets ImportError: libGL.so.1: cannot open shared object file: No such file or directory
asked Dec 18, 2019 alecxe 7.5k points
0 votes
1 answer 759 views
759 views
Problem : While trying to import the OpenCV, using import cv2 I facing the below error: /usr/local/lib/python2.7/dist-packages/cv2/__init__.py in <module>() 12 13 # make IDE's (PyCharm) autocompletion happy ----> 14 from .cv2 import * 15 16 # wildcard import ... - I am trying to play around with the Google's new Colaboratory tool. Please let me know if someone have solution for the above issue.
asked Dec 18, 2019 alecxe 7.5k points
1 vote
1 answer 492 views
492 views
Problem : I have recently installed the Visual Studio 2015 on my Windows 10 laptop. I have tried to clone the repository with the solution created with the same version of Visual Studio (update 3) on my another PC, always with windows 10. But when I try to build the ... my issue? I know one thing that I can update my laptop to the same windows version but I want to avoid it for many reasons.
asked Dec 14, 2019 alecxe 7.5k points
0 votes
1 answer 1.5K views
1.5K views
Problem : I am facing following error : ImportError: libcuda.so.1: cannot open shared object file: No such file or directory Failed to load the native TensorFlow runtime. Above error comes up when I tried to import the tensorflow. Is there anybody who has faced this error before and know the solution on it?
asked Dec 10, 2019 alecxe 7.5k points
0 votes
1 answer 253 views
253 views
Problem : I am building the TensorFlow from the source code. The build appears to succeed; but, when my TensorFlow program invokes the import tensorflow, one or both of the following errors starts appearing: · ImportError: libcudart.so.8.0: cannot open shared object file: No such file or directory · ImportError: libcudnn.5: cannot open shared object file: No such file or directory
asked Dec 9, 2019 alecxe 7.5k points