Skip to content
Prev 304290 / 398506 Next

write.table and read.table commands

On Aug 27, 2012, at 10:04 PM, R. Michael Weylandt <michael.weylandt at gmail.com
> wrote:

            
Notice that the error message was telling you that there was a  
`mean.data.frame` function which is slated for removal (perhaps) in  
the next version of R.

You can read about its  behavior:

?mean.data.frame


You could have gotten the desired behavior with:

mean(mean(j))

Or by saving the z object and load it as an Rdata file.

Or with

 > z=matrix(1:20,4,5)
 > write.table(z, file="exercise.csv",sep=",",row.names=FALSE,  
col.names=FALSE)
 > j=scan("exercise.csv",sep=",", what=double())
Read 20 items
 > mean(j)
[1] 10.5

(Although the numbers are now in a vector.)
David Winsemius, MD
Alameda, CA, USA