0
I use windows 64 bits, I have java installed and set the working directory in R. But, when running a simple code such as:
teste <- data.frame(a=c(2,2),b=c(3,3))
write.csv2(teste,file = "teste.csv")
I’m getting the following error:
Error in file(file, ifelse(append, "a", "w")) :
não é possível abrir a conexão
Além disso: Warning message:
In file(file, ifelse(append, "a", "w")) :
não foi possível abrir o arquivo 'teste.csv': Permission denied
If I try to use the code:
library(xlsx)
write.xlsx(data2, file="data2.xlsx", col.names=TRUE, row.names=FALSE)
Obtenho:
Error in .jcall(cell, "V", "setCellValue", value) :
method setCellValue with signature ([Ljava/lang/String;)V not found
Além disso: Warning message:
In if (is.na(value)) { :
a condição tem comprimento > 1 e somente o primeiro elemento será usado
Both codes worked on my machine, usually. They stopped working overnight. I’ve searched every possible page, reinstalled R and Rstudio, rebooted the machine, changed the files folder. I don’t know how else to do to solve this! Someone has been through similar problem and can help me?
It looks like a problem with the java call, make sure your machine has JDK installed as you cite the package documentation: https://www.rdocumentation.org/packages/xlsx/versions/0.6.3
– Lucas Marcondes Pavelski
As Lucas said it looks like a problem with Java, which system do you use? Are you saving in which directory? Java is installed?
– lmonferrari
Are you running R where? Have you set the working directory? You have write permission for it?
– Carlos Eduardo Lagosta
I am running windows, yes I have Java installed. The working directory has been set, I have full permission to write to it!
– fsbmat
Are you setting the file path correctly? Because using R in windows you have to pass the path with / and not with . Example: C: so it doesn’t work but so it works: C:/
– lmonferrari
I’m setting it correctly, I’ve done it a million times. As I said, I’ve researched every possible forum, I can’t understand this mistake! There are many people with the same problem! I hope that those who gave "downvote" the question never face the same problem!
– fsbmat
I also didn’t understand the down vote on the question.But from this site I don’t doubt anything. There are people who copy their solution, put on top and still take credit. Give of everything here
– lmonferrari