Re: [R] Using multiple dat files

2024-11-06 Thread David Winsemius via R-help
On 11/5/24 22:29, Sibylle Stöckli via R-help wrote: 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

Re: [R] Using multiple dat files

2024-11-06 Thread Bert Gunter
Sorry, wrong language. "through the function's closures" in my email should be: through the function's chain of environments. (A function in R *is* a closure). -- Bert On Wed, Nov 6, 2024 at 12:46 PM Bert Gunter wrote: > "It seems therefore that there is no other way than read in individually

Re: [R] Using multiple dat files

2024-11-06 Thread Bert Gunter
"It seems therefore that there is no other way than read in individually > 100 weather tables using read.tables., right? Using file.choose() doesn't change the work." Yes. With that many files, file.choose() does not make sense. However, I still do not understand what is the problem with using lap

Re: [R] Using multiple dat files

2024-11-06 Thread Bert Gunter
Not quite sure if I understand you. list.files() simply returns a character vector(not a list). You can simply use a vector index to select whatever file you wish to read. So if your desired filename is the 5th element of filelist above, something like myfile <- read.table(filename[5], ...) You

Re: [R] Using multiple dat files

2024-11-06 Thread Rui Barradas
Às 06:29 de 06/11/2024, Sibylle Stöckli via R-help escreveu: 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

[R] Using multiple dat files

2024-11-06 Thread Sibylle Stöckli via R-help
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 specifi