Problem with install.packages("ca")

When I run this:


children <- read.table(file="children.csv", sep=",")
CA <- ca(children) #function ca() from package ca

I get this afterwards:

The downloaded binary packages are in

library(ca) # to load it
children <- read.table(file="children.csv", sep=",")
Error in file(file, "rt") : cannot open the connection
In addition: Warning message:
In file(file, "rt") :
cannot open file 'children.csv': No such file or directory

What can I do to open the file?

to open the file with this code the file must be in the working directory.
you can use getwd() and setwd()

This doesn't seem like a package installation problem, since you don't mention a problem with either install.packages() or library().

Also, as far as I can tell, there is no dataset called children in the package ca, so this problem most likely has nothing to do with the ca package at all.

Instead, the error indicates that the file children.csv does not exist.

If the file does exist on your machine, try to specify the full path to this file when you do the read.table(), e.g:


Finally, note that you can use read.csv() to more easily read CSV files.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.