Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.(5)

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

ITtutoria

ITtutoria Logo ITtutoria Logo

ITtutoria Navigation

  • Python
  • Java
  • Reactjs
  • JavaScript
  • R
  • PySpark
  • MYSQL
  • Pandas
  • QA
  • C++
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA
Home/Questions/Error in file(con, "r") : cannot open the connection - simple solution when encountering the error.
Next
Answered
Kali Martin
  • 22
Kali Martin
Asked: May 18, 20222022-05-18T21:48:25+00:00 2022-05-18T21:48:25+00:00In: r

Error in file(con, “r”) : cannot open the connection – simple solution when encountering the error.

  • 22

Hi everyone, I’m learning about R. While working, I try to run BRugsFit() in my working process. As a result, I get the message:

> output = BRugsFit("model.txt", data, inits, numChains = 2, seed=6, parametersToSave,nBurnin = 100,nIter = 1000, nThin = 5, coda = T,digits = 5)
 
 ****
 * BlackBox
 * string too long
 - HostFiles.Init (pc=00003FB1, fp=BFFDE550)
 - HostFiles.$ (pc=0000000A, fp=BFFDE560)
 ****
 Error in file(con, "r") : cannot open the connection
 In addition: Warning message:
 In file(con, "r") :
  cannot open file '/tmp/RtmpU7v9PZ/buffer.txt': No such file or directory

What can I do about the “error in file(con, “r”) : cannot open the connection” issue? Is there a better approach?

error in file(conr
  • 2 2 Answers
  • 169 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  • Random
  1. Best Answer
    lyytutoria Expert
    2022-06-28T03:52:47+00:00Added an answer on June 28, 2022 at 3:52 am

    The cause:

    You encounter this error because you are attempting to make a temporary directory but you cannot write the file in that directory ialthough you have converted permissions.

    Solution:

    You can solve this error by altering the file’s extension. The code would only accept one extension, in spite of the fact that both of them were associated with the same file type. Sometimes all it asks is to restart the console or terminal, load the libraries once more time at startup. (Assumed that the GUI will work without saving or using a previous workspace).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Inès Pereira
    2022-05-25T21:22:43+00:00Added an answer on May 25, 2022 at 9:22 pm

    It informs you that model.txt is not available. Please indicate the complete path to the file.

    output <- BRugsFit("/path/to/file/model.txt", data, inits, numChains = 2, seed=6, parametersToSave,nBurnin = 100,nIter = 1000, nThin = 5, coda = T,digits = 5)

    Set the setwd working directory first

    setwd("/path/to/file/")
    • 23
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

Sidebar

Ask A Question

  • How to Split String by space in C++
  • How To Convert A Pandas DataFrame Column To A List
  • How to Replace Multiple Characters in A String in Python?
  • How To Remove Special Characters From String Python

Explore

  • Home
  • Tutorial

Footer

ITtutoria

ITtutoria

This website is user friendly and will facilitate transferring knowledge. It would be useful for a self-initiated learning process.

@ ITTutoria Co Ltd.

Tutorial

  • Home
  • Python
  • Science
  • Java
  • JavaScript
  • Reactjs
  • Nodejs
  • Tools
  • QA

Legal Stuff

  • About Us
  • Terms of Use
  • Privacy Policy
  • Contact Us

DMCA.com Protection Status

Help

  • Knowledge Base
  • Support

Follow

© 2022 Ittutoria. All Rights Reserved.

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.