[R] initializing table and filling it out

From: Cuau <cuauv_at_yahoo.com>
Date: Fri 30 Jun 2006 - 01:33:33 EST

   Hi everyone,   

     I'm writting a script that will open multiple files in a single folder and then will do some calculations to finally save everything in a big table.    So here is the pseudo code   

#read all files in the given directory
  myfiles <-list.files("c:\\myDir")   

#initialize table


#loop through files

  for(f in myfiles[-1]) {
    netMat <- read.table( f, sep" " )
    netMat <-as.matrix(netMat)   

   # calculate the needed Stats

   centralization(netMat, degree) -> Gdegree
   centralization(netMat, betweenness) -> Gbetweenness
   centralization(netMat, closeness) -> Gcloseness

#store into table



    So my questions are two   

   First how can I initialize the table (it will be a 4 X 1001 table) without filling it out first.   Second how can I store each value in the table (i.e. in each round I'll be adding one full column with density and the 3 different centralizations)?   



        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jun 30 01:37:43 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 30 Jun 2006 - 02:12:40 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.