Bret Collier <[EMAIL PROTECTED]> writes:
> I hope this is not a uniformed question, but I am a little lost.
>
> I ran into a problem this morning and I was wondering if anyone had
> seen it before. I was trying to summarize each column of a data set
> (150,000 rows, ~50mb, so it was a relatively big file) imported from a text
> file using the below code;
>
> data.summary <- read.csv("c:/summary.txt", sep="")
> data.summary <- as.matrix(data.summary)
> my.summary <- function(x){
> return(c(min=min(x),max=max(x), mean=mean(x)))}
> apply(data.summary, 2, my.summary)
Peter responded about the error. You may be able to circumvent the
error by using
apply(data.summary, 2, range)
to get the minimum and maximum and
colMeans(data.summary)
to get the means. Those are internal functions and will generate less
overhead (and fewer copies) than calls to your own function.
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html