Displaying 20 results from an estimated 721 matches for "setwd".
2012 Jul 30
1
locked binding of setwd() in R 2.15.x causes .Rprofile to fail
[Env: Win XP, R 2.14.2, R 2.15.0]
I have a replacement function for setwd() in my .Rprofile which displays
the current R path in the R window
title. It no longer works in R 2.15.x, giving the error below. Worse,
the error prevents the rest of my
.Rprofile script from completing.
Is there some way to rescue this, i.e., preserve this behavior in
R 2.15? If not, how can...
2013 Feb 07
1
assignInNamespace to create a setwd() replacement: how to use unlockBinding()?
In my .Rprofile for Windows, I had the following functions defined to
mirror a few features
I miss from linux:
(a) replace setwd() with a version that stashes the current directory so
it can be easily restored
(b) writes a short version of the current R directory to the Windows
title bar: I can always see where I am,
with multiple Rgui windows.
(c) creates a cd() shorthand for setwd(), but with the difference that
cd() ac...
2009 Oct 30
1
.Rprofile replacement function setwd() causing errors
In my .Rprofile I have the following functions which display the
current directory in the main R window title bar,
and modify base::setwd() to keep this up to date. I like this because I
can always tell where I am in the file system.
cd <- function(dir) {
base::setwd(dir)
utils::setWindowTitle( short.path(base::getwd()) )
}
short.path <- function(dir, len=2) {
np <-length(parts <- unlist(strsplit(dir, '/...
2017 Jul 14
3
setwd in windows
Dear friends - windows R 3.3.3 - sorry to ask a simple question - but I
cannot make setwd work properly in scripts
In the example below I have made a directory in C (firstdir) and a
directory in that (secdir) and the intention is to change directory to
the second from the first - it works when I put the entire path but not
the tilde - what am I missing? I was around rwf 2.14 as per...
2004 Jun 21
2
setwd problems
Hello,
I am using R for Windows and I receive error messages when trying to
change my working directory:
> setwd('C:\BACC_R')
Error in setwd(dir) : cannot change working directory
I would really appreciate your help,
Joan Serra
2009 Jan 20
2
Sweave: conflict between setwd and \SweaveOpts{prefix.string=}
Hello
I think there is a conflict between setwd() and
\SweaveOpts{prefix.string=}. In the same document, those both command
get Sweave confuse the files and directories. See:
say my .Rnw document is in File1
If one inserts some setwd() for another file:
-setwd(File2)
then the command \SweaveOpts{prefix.string=graphics/Rplots} will search
t...
2012 Nov 02
3
Strange behaviour of setwd/getwd
I've found the following strange behaviour R (RStudio) which has been
confirmed by another user in RGui.
Inside a script I want to set two variables:
default.wd = getwd()
tmp.wd = setwd(choose.dir())
After choosing tmp.wd the value of default.wd is shown in Workspace, but
getwd() is giving back the correct string of tmp.wd.
Is there a workaround for the problem?
I'm working on RStudio 0.96.228 and R 2.15.2.
Regards
Markus
2008 Dec 04
1
setwd and list.files / linux
Hey,
two questions regarding setwd and list.files:
I try to use the function list.files:
>datapath<-'/nfs/home/m/cremer/gaw/data/traws_chrs'
>fl<-list.files(datapath, pattern="\\.tped")
but I get the following error message:
Warning message:
In list.files(datapath, pattern = "\\.tped") :...
2008 Jan 06
3
run setwd at the launch of R
Dear all,
my R files (and the .csv files as well) are saved somewhere pretty
deep down my hard disk.
i have to chage to working directory therefore everytime i run R (i
run it on powerPC mac), which is disgusting.
using the setwd command at the beginning of an R script doesnt really
help because i have to find this file first by hand.
I am looking for possibility to run setwd during the launch process
of R are straight after it ... any suggestions ?
i would be very glad about good ideas or help !
thanks in advance
m...
2012 Feb 26
2
Help needed! Error in setwd(newdir) : cannot change working directory
Hi Guys,
I am new to R and just trying to write a small script to automate a couple commands. But I run into the setwd(): cannot change working directory.
I googled a little bit and tried all fixes/suggestions with no success.
Basically I have a script that works from inside a directory with my data (/home/sean/Rtest/Data01). Now I want to modify the script to make it run from the upper directory (/home/sean/Rtest)...
2013 Jan 11
1
Patch for setwd() to show path in error message
Below is a patch for setwd() to show path in error message. Current
it just gives error messages such as:
Error in setwd(libdir) : cannot change working directory
with the patch it should (read untested) give:
Error in setwd(libdir) : cannot change working directory to 'path/that/fails/'
PATCH:
% diff -u util....
2012 Mar 21
3
"cannot change working directory"
...d within the same file). when i wrote the program for "tuesday" i had
no problem running it, but when i changed the work directory to wednesday i
got the "cannot change working directory" message. I don't understand what's
different between the two.
my first code was:
setwd("/Users/user/Desktop/Recorded\ results/tuesday")
and my second code is:
setwd("/Users/user/Desktop/Recorded\ results/wednesday")
and i copied the exact location from the terminal, so i can't have typos (i
am using a mac, if that makes any difference).
any suggestions? i...
2004 Mar 20
1
setwd() permenent
Hello
when I close and reopen R it gives back a different wd
than what I used in setwd. how can I get it to
permenently use dirname in setwd("dirname") and not
the other name it keeps defaulting to?
I am using W2K and ESS
thanks
2013 Feb 20
4
Error in setwd(outDir) : cannot change working directory
...testInstalledBasic("both")
testInstalledPackages("base", errorsAreFatal = FALSE)
testInstalledPackages("recommended", errorsAreFatal = FALSE)
I am getting errors such as:
> testInstalledPackages("base",errorsAreFatal=FALSE)
Error in setwd(outDir) : cannot change working directory
my working driectory is:
>getwd()
[1] "C:/Users/jpapa/Documents"
In which I see R folder as well as the .rData from my last session.
what does the wd have to do with the output directory? Do I need to create
an output directory? DO I ne...
2024 Dec 18
2
Query concerning working directory for file.choose()
...ctories and move them around in planned ways. file.choose() is a nice way to select
files. However, I've noticed that if file.choose() is called within a function, it is the
directory from which that calling function has been invoked that is displayed by file.choose().
This is not altered if I setwd() within that function. Have I misunderstood something or is this
an infelicity of file.choose(). sessionInfo() gives my system as
R version 4.4.2 (2024-10-31)
Platform: x86_64-pc-linux-gnu
Running under: Linux Mint 22
I've a small example script. It actually helps to create nd1 and nd2 and gi...
2023 Nov 20
1
Error in setwd(dir) when initializing R
On Mon, 20 Nov 2023 12:18:11 +0100
Ana de las Heras Molina <andelash at ucm.es> wrote:
> Error in setwd(dir) : no es posible cambiar el directorio de trabajo
If you run traceback() first thing after getting this error, does it
say anything useful? (Anything besides "No traceback available" would
count as useful.)
Do you have a file named .RData in your home directory? If yes, it may
help...
2005 Dec 14
2
Problem with dir.create (R2.2.0 Windows XP 2002 SP 2)
I've run into a problem with dir.create on R2.2.0 Windows XP 2002 SP 2.
setwd("d:/")
print(dir.create("d:\\otis-sim\\rdata", recursive=T))
print(dir.create("d:\\otis-sim\\", recursive=T))
Both return false and fail to create the directories.
setwd("c:/")
print(dir.create("d:\\otis-sim\\rdata", recursive=T))
Returns true an...
2008 Feb 29
2
setwd on other computer?
hi members,
is it possible to set the work directory ( e.g. via setwd() ) on a other
computer than R has been started?
thanks
paul
2012 Nov 05
2
Problem compiling Rnw file
Dear R list,
I'm using R 2.15.2 with TeX Live 2009 and ESS 12.09 . I have a R
project in the '/home/r/Documents/myproj/', which is my working
directory (where I have the .Rnw file). Inside the document I have
several "setwd()" to collect the datasets I use.
After I compile from the terminal using "R CMD Sweave myproj.Rnw", I
receive the error:
Error in driver$finish(drobj) :
the output file 'myproj.tex' has disappeared
Calls: <Anonymous> -> do.call -> <Anonymous> -> <...
2024 Dec 18
2
Query concerning working directory for file.choose()
...em around in planned ways. file.choose() is a nice way to select
> files. However, I've noticed that if file.choose() is called within a function, it is the
> directory from which that calling function has been invoked that is displayed by file.choose().
>
> This is not altered if I setwd() within that function. Have I misunderstood something or is this
> an infelicity of file.choose(). sessionInfo() gives my system as
> R version 4.4.2 (2024-10-31)
> Platform: x86_64-pc-linux-gnu
> Running under: Linux Mint 22
>
> I've a small example script. It actually helps...