Dear community To import multiple .dat weather files I am using list.files(). I intend to use the R package “ClimInd” to calculate different agroclimatic indicators.
Question: Is there another solution to import multiple .dat files so that I can select elements from the list, e.g. one specific weather file (example AAR_DailyWeather)? # Import multiple .dat files weather data filelist <- list.files(path = "O:/Data-Work/……./Daten_RA-MeteoCH_1990-2021", pattern='*.dat', all.files= T, full.names= T) W <- lapply(filelist, function(x) read.table(x, header = TRUE, sep = "", colClasses = "numeric", comment.char = "")) W[[1]] > dd(data = W[[1]]$Precip, time.scale = W[[1]]$year) Fehler in W[[1]]$year : $ operator is invalid for atomic vectors Kind regards Sibylle ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.