[R] How to solve: error in file(file, "rt") : invalid 'description' argument

catherine peters catherine.h.peters at googlemail.com
Wed Apr 29 01:02:18 CEST 2015


Hi thank you in advance for your assistance. 

I am using the following section of script: 

DirPath_folder 
<-Sys.glob(file.path("/Users/catpeters/Documents/R_working_directory/1_Data_MC_Sorted")) 

for (folder in 1: length(DirPath_folder)) { 

# ## EVERY Control and Impact # 
DirPath_Matrix <-Sys.glob(file.path(DirPath_folder[folder], 
"*Markov_Matrix_Month.txt")) 

data <- read.table(DirPath_Matrix, header = TRUE, sep = ";") 

if (folder ==1) { DATA_ALL1 <- data } else { DATA_ALL1 <- rbind(DATA_ALL1, 
data) } 

if (folder == length(DirPath_folder)) { 
setwd("/Users/catpeters/Documents/R_working_directory/1_Data_MC_Sorted") 
write.table(DATA_ALL1 ,"Matrix_Markov_ALL_MONTH_RB.txt" , col.names=TRUE, 
row.names=FALSE, sep=";") write.table(DATA_ALL1 
,"Matrix_Markov_ALL_MONTH_RB.csv" , col.names=TRUE, row.names=FALSE, 
sep=";") } } 

There seems to be a problem with: data <- read.table(DirPath_Matrix, header 
= TRUE, sep = ";"). When run it returns the Error in file(file, "rt") : 
invalid 'description' argument. This has worked previously and I'm not sure 
where the error is. 

Thanks again 
	[[alternative HTML version deleted]]



More information about the R-help mailing list