-1

error

I'm trying to do a confirmatory factor analysis on R for the first time.
I've researched this error and nothing helped so far (changing the working directory and so on).

Creating my model worked. But when I try to run the "fit" I get the error with

"Error in file(file, "r"): cannot open connection".

My first data frame is saved in "downloads" folder of my Mac. But I'm working with data Frame "data4" which is saved in a different folder. data4 is in the same folder as the whole project. It seems like the error has something to do with the path.

I also tried:

fit <- cfa(model, data = "~/Documents/BACHELORARBEIT/Daten/data4.RData, missing = "ML")

instead of:

fit <- cfa(model, data = data4, missing = "ML")

but I still get the same error message.

thank you in advance!!!

MLavoie
  • 9,671
  • 41
  • 36
  • 56

1 Answers1

0

It seems you have set up the wrong working direction.
The easiest Solution would be to put all your files and the script in the same folder and just use on the toolbar:
Session -> Set working direction ->to source file.
Or check this post and see it can help.

Mojo
  • 1
  • 3