Dear R users,

hope you can point me in the right direction. I am stuck with the following
problem.

My function "f1" reads csv files, manipulates them into the right xts
format and returns the output at the end. This works perfectly fine. Now, I
need to run "f1" over a long list of various csv files, all of the same
format, but different dates (or time stamps) which is guaranteed by design.
All these individual results per each file I hope to combine into one xts
or zoo object.

I tried "lapply" as follows:

# all csv files start with "z1":
file.names <- list.files(pattern = "z1*", full.names = T, recursive = FALSE)

# my function:
f1 <- function(x, param){
# x: the csv file
# param: some parameter for calculation
# spits results out
return(results)
}

res <- lapply(file.names, function(x){f1(x, param)})

I wrote the output to "res" and by subsetting res[1], res[2], ... I can
retrieve the results of each individual csv file on which I applied my
function "f1".

How could I append or merge all individual results res[i] for my i csv
files into one xts or zoo object?

Many thanks in advance,

Bernard

        [[alternative HTML version deleted]]

______________________________________________
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 http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to