Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
158 views

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 ...
Jared Nel's user avatar
0 votes
1 answer
134 views

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 ...
Alice Hobbs's user avatar
  • 1,247
1 vote
1 answer
222 views

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/...
codingproblem's user avatar
2 votes
1 answer
2k views

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 ...
user avatar
0 votes
0 answers
641 views

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 ...
jaynesw's user avatar
  • 43
0 votes
1 answer
339 views

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 ...
Nadiine El Nino's user avatar
2 votes
2 answers
1k views

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" ...
user35131's user avatar
  • 1,134
0 votes
2 answers
1k views

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 &...
Vianey Rueda's user avatar
1 vote
1 answer
743 views

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:\...
anderwyang's user avatar
  • 2,547
0 votes
2 answers
978 views

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 ...
dkro23's user avatar
  • 15
1 vote
1 answer
83 views

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....
vermicellion's user avatar
2 votes
2 answers
5k views

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()?
KK47's user avatar
  • 25
0 votes
1 answer
1k views

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 (...
melmo's user avatar
  • 825
1 vote
2 answers
129 views

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 ...
Will's user avatar
  • 1,885
0 votes
2 answers
348 views

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 ...
Aman Vishwakarma's user avatar
0 votes
0 answers
291 views

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 ...
Alexandre Sanches's user avatar
0 votes
0 answers
543 views

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. ...
Diego Esparza's user avatar
4 votes
1 answer
42k views

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 ...
sociolog's user avatar
  • 111
1 vote
0 answers
4k views

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 ...
Paw in Data's user avatar
  • 1,714
2 votes
1 answer
548 views

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 ...
Joachim Schork's user avatar
1 vote
1 answer
542 views

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 ...
Danny's user avatar
  • 574
3 votes
1 answer
17k views

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 ...
M.Raynaud's user avatar
2 votes
5 answers
16k views

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 ...
Vanessa M's user avatar
1 vote
0 answers
385 views

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 ...
Hokun Jeon's user avatar
4 votes
0 answers
8k views

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" ...
Rose Savage's user avatar
0 votes
0 answers
4k views

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 ...
Paul Rougieux's user avatar
-1 votes
1 answer
679 views

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 ...
Nils's user avatar
  • 127
0 votes
1 answer
6k views

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 ...
SchrodingersStat's user avatar
0 votes
1 answer
669 views

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 ...
Nicholas Ferranti's user avatar
1 vote
1 answer
388 views

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 ...
rienix's user avatar
  • 771
6 votes
2 answers
1k views

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 ...
N Brouwer's user avatar
  • 5,108
0 votes
1 answer
5k views

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 ...
ELC's user avatar
  • 3
27 votes
5 answers
24k views

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 ...
BhishanPoudel's user avatar
0 votes
1 answer
516 views

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 ...
Ayushi Kachhara's user avatar
4 votes
1 answer
176 views

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 ...
Roman's user avatar
  • 132k
2 votes
1 answer
410 views

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 ...
istudybrains's user avatar
-2 votes
1 answer
269 views

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 ...
bcosc's user avatar
  • 11
4 votes
3 answers
11k views

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")) } ...
user3540633's user avatar
1 vote
2 answers
245 views

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 ...
mjktfw's user avatar
  • 870
2 votes
1 answer
866 views

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 ...
Napmi's user avatar
  • 541
3 votes
1 answer
6k views

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 ...
user1665355's user avatar
  • 3,393
27 votes
6 answers
12k views

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?
Ricardo Saporta's user avatar