similar to: locked binding of setwd() in R 2.15.x causes .Rprofile to fail

Displaying 20 results from an estimated 4000 matches similar to: "locked binding of setwd() in R 2.15.x causes .Rprofile to fail"

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
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
2012 May 02
2
Función para devolver nombre del área de trabajo en uso
¡Hola! ¿Alguien sabe si existe una función en R que devuelve el nombre del área de trabajo (workspace) en uso si éste ha sido guardado anteriormente? Con getwd() R me devuelve la carpeta de trabajo, pero si en ésta tengo varios áreas de trabajo guardados, p.e. a.RData y b.RData, ¿cómo podría saber en cuál estoy trabajando si por un despiste no me acordara cuál he abierto anteriormente (sin tener
2018 Apr 18
2
odd assignInNamespace / setGeneric interaction
A coworker got tired of having to type 'yes' or 'no' after quitting R: he never wanted to save the R workspace when quitting. So he added assignInNamespace lines to his .Rprofile file to replace base::q with one that, by default, called the original with save="no".. utils::assignInNamespace(".qOrig", base::q, "base")
2018 Apr 19
2
odd assignInNamespace / setGeneric interaction
>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>> on Wed, 18 Apr 2018 14:16:37 -0700 writes: > Hi Bill, > Ideally, your coworker would just make an alias (or shortcut or > whatever) for R that passed --no-save to R. I'll try to look into this > though. > Michael Yes, indeed! As some of you know, I've
2013 Feb 20
4
Error in setwd(outDir) : cannot change working directory
I installed R on my Windows laptop in C:\Program Files\R\R-2.15.2 and am able to open RGUI (640bit), see packages and run commands. However, when I test the installation and run the basic tests and all the tests on the standard and recommended packages i.e.: library("tools") testInstalledBasic("both") testInstalledPackages("base", errorsAreFatal
2012 Dec 11
1
Reassign functions called by other functions in package graphics
I am trying to get a function written in R that calls a cascade of functions from the graphics package, and I want to eventually call replacements to functions in the graphics package instead of the originals. Specifically, I have a function that calls qqnorm in stats, which calls qqnorm.default in stats, which calls plot in graphics, which calls plot.default and plot.new, and I want my own
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
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
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 the "graphics" folder in File2 because of
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") : list.files: '/nfs/home/m/cremer/gaw/data/traws_chrs/'
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
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 the help
2011 May 31
1
assignInNamespace and new bindings
Hello, assignInNamespace refuses to assign an object to a name that is not already used in the namespace. Something like this would make it possible: --- src/library/utils/R/objects.R (revision 56024) +++ src/library/utils/R/objects.R (working copy) @@ -252,8 +252,9 @@ stop("environment specified is not a package") ns <- asNamespace(substring(nm, 9L))
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
2005 Sep 25
0
Tip: Working directory in titlebar
I hope others may find this useful. I use R in many different directories. By adding the following line to the .Rprofile file: utils:::setWindowTitle(paste("-",getwd())) the titlebar of each R instance shows the directory from which it was started. I have tested this with rterm.exe and rgui.exe under Windows and with RECENT versions of R only. ----- For changing directories
2017 Aug 05
3
Error in setwd("dir") :
Hello, I got some of the R source code and not being able to Run it in RStudio. I get the error: Error in setwd("dir") : cannot change working directory I have gone through forums but nothing seemed relevant to my issue. What bugs me the most is the ("dir") that the error shows, is of those who wrote the source code and not mine(it still sees the directory of their
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.c "util,patch.c" --- util.c 2012-12-16 13:13:05.002249900
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
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