error : object of type 'closure' is not subsettable

library(fitdistrplus)
library(MASS)
library(survival)
library(tidyverse)
library(ggplot2)
library(actuar)
library(e1071)
library(FAdist)
library(gld)
library(MonteCarlo)
library(snow)

archivos <- c("2014_1.csv",
"2014_2.csv",
"2014_3.csv",
"2014_4.csv",
"2015_1.csv",
"2015_2.csv",
"2015_3.csv",
"2015_4.csv",
"2016_1.csv",
"2016_2.csv",
"2016_3.csv",
"2016_4.csv",
"2017_1.csv",
"2017_2.csv",
"2017_3.csv",
"2017_4.csv",
"2018_1.csv",
"2018_2.csv",
"2018_3.csv",
"2018_4.csv",
"2019_1.csv")

lista_df <- lapply(archivos, function (x) read.table(x, sep=";",header=T))
df_unido <- reduce(rbind,lista_df)

I don´t know what happened, but before df_unido works, and now return me the error: Error in x[[1]] : object of type 'closure' is not subsettable

Hi @vd97,

Without your data I can't really verify the issue, but try this code and let me know if it works for you:

library(purrr)
library(readr)

df_unido <- map_dfr(archivos, ~read_delim(., sep = ';'))

Thanks, but the code doesn´t work, it give me this error: Error in read_delim(., sep = ";") : unused argument (sep = ";")

Believe me, my code is bigger than this part, but whatever that I move or run for them, they give me an error on any part

Oops, spelling error on my part:

df_unido <- map_dfr(archivos, ~read_delim(., delim = ';'))

If this code used to work then very likely the structure of your input has changed recently, any chance you could share a link to a couple of your .csv files so we can take a look?

No, that time give me this error: Error: Column CONCENTRACION_NOX_PPM can't be converted from logical to numeric; I ´m seeing how to upload a bit of my data

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.