2
How to load Rdata files that are in the same directory as the file . R, in Rstudio?
Here, for example, is the line:
load('teste.RData')
When loaded, it returns...
Erro em readChar(con, 5L, useBytes = TRUE) :
não é possível abrir a conexão
Além disso: Mensagens de aviso perdidas:
In readChar(con, 5L, useBytes = TRUE) :
não foi possível abrir o arquivo comprimido 'teste.RData', motivo provável 'Arquivo ou diretório não encontrado'
This does not occur when I give the folder path:
load('~/Downloads/teste.RData')
Why does this occur? It is normal? How to do to load without giving all the way?
There is no way to put it right in the path? I downloaded a zip from a friend of mine and put a Rdata file and an R in the same directory. In R, there was already the
load("arquivo.RData")
. Even in this case, I need to set the working directory?– Guilherme Duarte
I’m not sure I understand your question. You can change the file. Rprofile, so it changes the default directory on startup. Is that what you want, for R to change the default directory every time you start? If it is, I edit my answer to explain how you do it.
– Manoel Galdino
R file is loaded into Rstudio. I want to know how to load the Rdata that is in the same directory as the R file, without having to refer directly to which directory is in the line
load
.– Guilherme Duarte
an alternative to changing . Rprofile is to make use of Rstudio’s R Project. One of the things it does is to set the folder associated with the project as the default directory, plus other advantages.
– Athos
Very good, @Athos
– Guilherme Duarte