On Jul 3, 2011, at 8:24 AM, David Winsemius wrote:


On Jul 3, 2011, at 12:51 AM, Sergio Mira wrote:

Hi,

Could anyone help me with this error? I have no idea what that is about...

file <- system.file("DADOSCASUMCCORMICK.xlsx", package = "xlsx")
> data <- read.xlsx(file, 1)
Error in .jnew("java/io/FileInputStream", file) :
 java.io.FileNotFoundException:  (No such file or directory)

Is there really a file by that name in your package directory? When I do that on my machine, file is "" after the first command, which is the documented behavior when the file cannot be found.

My guess is that you need to provide a path and append it to the file name before sending a request to system.file. I'm also suggestinging that you don't really want to be saving you work files in system directories and you should be using getwd() and paste()- ing to your file name.

On re-reading this I see that it was unclear that I was suggesting _not_ using system.file for this task. Just use getwd() and paste to construct a path/file.ext.



Thanks!

--
Regards,
|| ------
|| Sergio Henrique Bento de Mira
|| Computer Science | Class of 2008/2

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to