Re: [R] error message from read.csv in loop

2021-07-10 Thread Migdonio González
Thank you very much for the clarification. I will try to use a more precise language next time. Warm regards Migdonio G. On Sat, Jul 10, 2021 at 11:30 AM Bert Gunter wrote: > "It seems that your problem is that you are using single quotes inside of > the double quotes." > > That is FALSE. From

Re: [R] error message from read.csv in loop

2021-07-10 Thread Duncan Murdoch
On 10/07/2021 12:30 p.m., Bert Gunter wrote: "It seems that your problem is that you are using single quotes inside of the double quotes." That is FALSE. From ?Quotes: "Single and double quotes delimit character constants. They can be used interchangeably but double quotes are preferred (and

Re: [R] error message from read.csv in loop

2021-07-10 Thread Bert Gunter
"It seems that your problem is that you are using single quotes inside of the double quotes." That is FALSE. From ?Quotes: "Single and double quotes delimit character constants. They can be used interchangeably but double quotes are preferred (and character constants are printed using double

Re: [R] error message from read.csv in loop

2021-07-10 Thread Migdonio González
Hello Kai, Just as you did to store the data inside of rr. Try class(rr[[1]]) or class(rr[[2]]) and so on to explore a bit more. The variable rr is a list that contains dataframes within it. To access the dataframes you must use the syntax rr[[i]] where i is the index of the element of the list

Re: [R] error message from read.csv in loop

2021-07-10 Thread Migdonio González
It seems that your problem is that you are using single quotes inside of the double quotes. This is not necessary. Here is the corrected for-loop: for (j in 1:nrow(ora)) { mycol <- ora[j,"fname"] mycsv <- paste0(mycol,".csv") rdcsv <-

Re: [R] error message from read.csv in loop

2021-07-10 Thread Rui Barradas
Hello, 1. When there are systematic errors, use ?try or, better yet, ?tryCatch. Something like the code below will create a list of errors and read in the data if none occurred. The code starts by creating an empty list for tryCatch results. It uses ?file.path instead of noquote/paste0 to

Re: [R] error message from read.csv in loop

2021-07-09 Thread Kai Yang via R-help
Hi Migdonio, I did try your code: # Initialize the rr variable as a list. rr <- as.list(rep(NA, nrow(ora))) # Run the for-loop to store all the CSVs in rr. for (j in 1:nrow(ora)) {         mycol  <- ora[j,"fname"]         mycsv  <- paste0(mycol,".csv")         rdcsv  <-

Re: [R] error message from read.csv in loop

2021-07-09 Thread Eric Berger
it complained about ASSAY_DEFINITIONS not about RESPONDENTS. Can you try with the ASSAY_DEFINITIONS file? On Fri, Jul 9, 2021 at 9:10 PM Kai Yang via R-help wrote: > Hello List, > I use for loop to read csv difference file into data frame rr. The data > frame rr will be deleted after a

[R] error message from read.csv in loop

2021-07-09 Thread Kai Yang via R-help
Hello List, I use for loop to read csv difference file into data frame rr.  The data frame rr will be deleted after a comparison and go to the next csv file.  Below is my code: for (j in 1:nrow(ora)) {   mycol  <- ora[j,"fname"]   mycsv  <- paste0(mycol,".csv'")   rdcsv  <-