[R] R function command on a list

From: G E <georgehret_at_gmail.com>
Date: Thu, 28 Jun 2007 13:12:24 -0400


Hello R:

   I am working with a self-defined function and I wish to subject a list (t) to this function. My list is a list of tables:
$rs7609589

2/2 2/4 4/4 2/2 2/4 4/4
 89 188 87 89 188 87

$rs3909907

1/1 1/4 4/4
 94 178 92

$rs12748004

0/0 1/3 3/3
 37 150 177

$rs6695928

2/2 2/4 4/4
 35 129 200

My function looks as follows:
delete_nocall_listoftables<-function(i){

    names<-names(i)
    i
    if (names[1] == "0/0"){

        i[-(1:1)]
    }else{

        i
    }
}

Within the function, how can I access the table name of a given element (e.g.
$rs3909907)? Using names(i) I get the header of the table...

Thanking you!
Georg.

        [[alternative HTML version deleted]]



R-help_at_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 and provide commented, minimal, self-contained, reproducible code. Received on Thu 28 Jun 2007 - 17:17:42 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 28 Jun 2007 - 19:32:34 GMT.

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