What I want to do is save one y dataframe for each file in the loop below.Right now, I only have the last one.

```
temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.csv)

for (file in myfiles){
 y <- some code
}

```

y has 26 observations of 2 variables. 

Sorry if this is not a working example. My data is too big even if taking samples. Any help is much appreciated.
['https://Stackoverflow.com/questions/48798101', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/7747528/']
`df <- do.call("rbind",lapply(list.files(pattern = "*.csv"),read.csv, header = TRUE))`

Here is an [example](https://stat.ethz.ch/pipermail/r-help/2003-April/032077.html).
If I understand well, you want to save `y` as a `csv`? You could do something like this:

```
temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.csv)
## Adding a counter to be incremented in the loop
counter <- 1

for (file in myfiles){
 y <- some code
 ## writing the csv
 write.csv(y, file = paste0("my_csv_", counter, ".csv")
 ## Increment the counter
 counter <- counter + 1
}

```

Or do you want to save `y` as a variable containing all your data.frames? In this case, you can do something like this:

```
temp = list.files(pattern="*.csv")
myfiles = lapply(temp, read.csv)
## Adding a counter to be incremented in the loop
counter <- 1
## Create an empty list y

for (file in myfiles){
 y[[counter]] <- some code
 ## Increment the counter
 counter <- counter + 1
}

```