42 questions
0
votes
1
answer
158
views
Google Sheets App Script Page to Print is blank, but the URL is correct - When running the app script
I am trying to create a button that, when clicked, prompts the user to print a specific sheet of information.
The script successfully saves the document as a PDF.
It also manages to open the document ...
0
votes
1
answer
135
views
How to use the function here::here() with the function source() to set the top level of your project folder in R
Issue
I'm trying to build a path to the top level of my project file by using the functions source(), here:here() into a new (empty) environment using the new.env() function to copy the data into the ...
1
vote
1
answer
222
views
Unable to use setwd() to change directory from absolute to relative pathway
I get 'cannot change working directory' when I try using setwd() to change my working directory from using an absolute pathway (from C:/examplename/Dropbox/Files) to a relative pathway (~/Dropbox/...
4
votes
1
answer
42k
views
Error setwd() "cannot change working directory" [closed]
I get "cannot change working directory" error when I try to set up my working directory:
setwd("C:\Users\alimo\Desktop\DataVisualizationwithggplot2.R")
*Error: '\U' used without ...
2
votes
1
answer
2k
views
How to set path in R in windows operating system using r'path\to\directory'?
In windows operating system (OS), for python, I can use os.chdir(r"path\to\directory\").
Is there any way that I can set the path in R also in similar way?.
One of the way known to me is ...
2
votes
2
answers
1k
views
How to open next folder in working directory for only one file?
I have a working directory
setwd("C:/User/WorkDirectory")
I have files in the working directory
"File 1.csv", "File 2.csv", "File 3.csv", "Folder 1"
...
2
votes
5
answers
16k
views
Setting a working directory: "Error in setwd: cannot change working directory" under "C:/Documents and Settings/..."
I was wondering why it won't let me change my working directory.
I keep seeing this error:
Error in setwd(dataDir) : cannot change working directory
This is my code:
dataDir <- "C:/Documents and ...
0
votes
0
answers
641
views
I cannot set/change my working directory directly in my R code. Instead, I have to manually set it in the file browser tab
For some reason, I am unable to set or change my working directory in my R-code itself. I'll include a line such as:
setwd("~/Documents/BeaverProject/HOBOData/Beav")
But it will be followed ...
2
votes
2
answers
5k
views
Read a file in R without changing the working directory
How can others who run my R program read a file(eg: csv) used in my R code without having to change the working directory in setwd()?
0
votes
2
answers
1k
views
Set wd in RStudio
I am creating a series of r scripts that will be used by multiple people, meaning that the working directory of files used and stored will differ. There are two folders, one for the R code, called &...
27
votes
5
answers
24k
views
How to set the current file location as the default working directory in R programming?
I want to make the current file location as the working directory.
Using Rstudio (Works!):
# Author : Bhishan Poudel
# Program : writehere.r
# Source : Rscript writehere.r
# set working ...
1
vote
1
answer
743
views
In R, how to change working directory more easily? [duplicate]
In how to change working directory more easily?
Currently, if we use 'setwd',we have to add many '\', sometimes it's boring
Is there any easier way for this ? (Just like Python can add 'r' )
setwd('C:\...
0
votes
1
answer
339
views
Changing WD in RMarkdown
My R Markdown script was running well until I had to access documents from another WD than my RMarkdown-file. I tried to change the WD. But it doesn't take it.
I might access documents from different ...
0
votes
2
answers
980
views
Is there a way to change all the directory path for all R files?
I recently got a new computer and moved all my work files over to it. The main issue is that the file structure is slightly different than from my previous computer. Therefore, for my R code to work ...
27
votes
6
answers
12k
views
risks of using setwd() in a script?
I've heard it said that it is bad practice to use setwd() in a script.
What are the risks/dangers associated with it?
What are better alternatives?
0
votes
1
answer
1k
views
R setwd() "Error while opening file - The system cannot find the file specified"
I have a R script that should change the working directory using setwd().
My code:
setwd(file.path(work_dir, database_dir, study))
I can pause my script just before this line is supposed to execute (...
0
votes
2
answers
348
views
Change working directory with another directory in plumber R
I am Creating Web Application with Plumber API in R. I was trying to change the working directory using plumber.
Currently the file is in C:/xampp/htdocs/testMDA i was trying to change the directory ...
3
votes
1
answer
17k
views
Opening Rdata file on R
I have some trouble to open Rdata files on Rstudio.
I tried different directory.
I tried the load() function.
I set up the file pathway with setwd().
I made sure that the file pathway did not ...
1
vote
0
answers
4k
views
Why can't I change the working directory in RStudio?
I got some example codes from a course that start with
install.packages('maps')
install.packages('geosphere')
library(maps)
library(geosphere)
setwd("C:\\mydata")
...
Everything was fine until the ...
1
vote
1
answer
83
views
loop through batch read folders in setwd(), format dfs & write.csv() to different folder R
I have folders with 4 .csv files in each folder. Currently I am batch reading the .csv files in the folder:
setwd("/Users/Drive/MS/Ma/Ec/Effort_variation_Ec/MES1/")
ecosmpr <-
list....
1
vote
2
answers
129
views
Go backward by N levels using setwd() in R
is there a way to go back in the directory using the R function setwd() by different levels?
for e.g.
> getwd()
/home/folder1/folder2/
I want to arrive in home in just one shot without typing ...
0
votes
0
answers
543
views
R: Error in setwd("C:/Users/diegoesparza/GitHub/covid_equity") : cannot change working directory. Why can't I change my working directory?
I have a folder named GitHub and a folder inside that one named covid_equity. I could only find similar examples where people tried to change their working directories to a file rather than a folder.
...
2
votes
1
answer
548
views
Automatically Set Working Directory to Currently Opened Folder in R
Is it possible in R to set the working directory to a currently opened folder automatically?
Example: Let's assume that I have currently opened the folder example_dir on my computer.
Now, I want to ...
0
votes
0
answers
291
views
Warning message in setwd - R
I have a workflow with three different operating systems and I use the switch function in R to change my working directory between them.
It works fine in Windows and macOS, but in Linux, returns a ...
1
vote
1
answer
542
views
Setting working directory R error u2069 cannot change working directory
Whenever I try to set the working directory I get an error message that says
Error in setwd("/Users/myname/Wedding\u2069") :
cannot change working directory
Specifically, the directory path is ...
4
votes
0
answers
8k
views
"Error in setwd(dir): cannot change working directory"
Trying to run a function where I set the directory to wherever is specified in the arguments.
However every time I do, I get the error message:
"Error in setwd(dir): cannot change working directory"
...
3
votes
1
answer
6k
views
How to save files from Rstudio AMI EC2 on my local computer
I have installed Rstudio server Amazon EC2. It works fine, but I can't understand how to save files on my local computer...
In example,
x=5
write.csv(x,file="x.csv")
getwd()
[1] "/home/rstudio"
I ...
0
votes
1
answer
6k
views
Trouble with setwd() in R
My apologies if this has been answered already, I've looked through many very similar threads but haven't found a solution. I'm new to R, just started a few days ago but I feel like I'm making decent ...
6
votes
2
answers
1k
views
Is it possible to define a cross-platform working directory for R?
I am teaching R tutorials in person w/ a large number of undergraduate R novices. I am also trying to format my notes on RPubs so that they can easily be used by other people. Nothing derails things ...
1
vote
0
answers
385
views
R package Installation failed: cannot change working directory
I get the following error message when trying to install package "rChart" in R:
**Installation failed: cannot change working directory**
Somebody advised me to install "Rcpp" before "rChart". So I ...
0
votes
0
answers
4k
views
How to use relative paths, relative to the project directory in an Rstudio notebook?
When working inside an R project, I like to use relative paths, relative to the root of the project directory. Since a couple of weeks, I have upgraded RStudio to the latest version which includes "R ...
4
votes
3
answers
11k
views
Setting working directory through a function
I am new to R. I am facing trouble setting my working directory through a function.
This is what I have tried:
myfunction<-function(directory)
{
setwd(paste(getwd(),("/directory"))
}
...
0
votes
1
answer
5k
views
"cannot change working directory" error using dir.create
I've created a set of nested folders using dir.create, and now I cannot set my working directory to any of them.
I've checked the spelling of the directory I wish to change to, and it is correct. It ...
0
votes
1
answer
669
views
ubuntu to windows find file path r setwd
So I have an Access database that I am trying to see on a windows server 2008 R2 (server name: WrenLab02); this server has the network discovery on, has the folder shared with that title, and is able ...
-1
votes
1
answer
679
views
Error message setwd()
I had to reset up my computer and changed to Ubuntu.
Version 1.0.136 – © 2009-2016 RStudio, Inc.
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko)
RStudio Safari/538.1 Qt/5.4.0
...
1
vote
1
answer
388
views
Path assignment to setwd() is delayed in for/foreach loop
The objective is to change within a for loop the current working directory and do some other stuff in it,.e.g. searching for files. The paths are stored in generic variables.
The R code I am running ...
0
votes
1
answer
516
views
R for loop works only for one file
I have been trying to run a for loop for multiple csv files in R. But the loop only runs for the first file.
I want to import csv files and then create a directory for each csv file where the ...
2
votes
1
answer
410
views
setwd error: directories within directories
Sorry this is long, but I'm a novice and want to be specific.
I have varied numbers of dataframes within a set of directories, within a set of directories. (That's 60 inner directories, hence I'm ...
2
votes
1
answer
866
views
R: setwd delay when using file.choose
So what im doing is making my browse button so that when i click on them bring the user straight to the directory that i want them to save their file in or look for their file.
For example
...
4
votes
1
answer
176
views
What is the philosophy behind the workspaces in R?
When I start R session from some directory, R automatically loads the corresponding workspace (if it exists). After I finish to work in this workspace I can decide if I want to modify (save) the ...
1
vote
2
answers
245
views
Convenient directory handling in R
Since I'm working with many subdirectories, I find setwd() pretty inconvient, as it demands from me to remember what are the current and previous location and change them back every time I perform ...
-2
votes
1
answer
269
views
Inputting a file in R without setwd()
I'm trying to input a text file into R using grep and using setwd() (I can use other methods, I'm not sure what, I'm only starting to learn R).
I'm writing a json template for a third-party server ...