Your objections are quite cogent, but I believe they are misdirected. I'm not 
at all interested in having my students ignore the existence of NA's and that's 
precisely why I'm not using the Default package as someone else suggested. But 
the mere existence of missing values in a data set doesn't make computation of 
the mean entirely useless -- why else would the na.rm option be available. If a 
student using my version of mean uses it to find the mean of a variable that 
has missing values, the function first prints a warning message and only then 
returns a value. Here's an example
 
> length(x)
[1] 101
> mean(x)
Warning: x has 3 missing values.
[1] 51.69388

My only goal in this project has been to provide them with a somewhat friendlyR 
version of R. It was not conceived as part of a quest to improve my programming 
proficiency, but my curiousity can be piqued when I run up against a 
programming problem.
 
Joel
 
 
 

________________________________

From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com]
Sent: Thu 8/13/2009 5:55 PM
To: Pitt, Joel
Cc: Erik Iverson; r-help@r-project.org
Subject: Re: [R] Coding problem: How can I extract substring of function 
callwithin the function



Hi,

On Aug 13, 2009, at 5:30 PM, Pitt, Joel wrote:

> Thanks. It's a great solution to part of my problem. It provides the 
> functionally I want would be no harder for students to use than my 
> approach. I'm still interested in how to make what I was trying to 
> do work -- simply to add to my own R programming proficiency.

I wasn't going to really chime in, but I couldn't help it given the 
irony in your last sentence (sorry, I don't mean to sound like an ass).

I think trying to help your students with some "bumps on the road" is 
admirable, but this seems just a bit misdirected. As you say, you are 
on a quest to add to your R programming proficiency, and will apply 
this newly founded technique to actively handicap your students' 
proficiency.

I guess you're teaching some intro stat analysis class, and waving 
over the fact that functions like mean explicitly return NA in the 
presence of NA's, but this is important to know and recognize when 
analyzing any real data, because there will surely be NA's "in the 
wild." Knowing that you should consciously and deliberately deal with/
ignore them from the start might be a good first/early lesson for 
students to digest.

Like I said, I don't mean to sound like an ass, but I think glossing 
over details of working with data should be avoided. Your other 
additions, like adding options to plotting/graphing functions, seem 
less harmful to me. But if you're trampling over some base:: function 
for something trivial like changing the value of one default parameter 
to something else, you might as well just get them to learn how to use 
the ?<function_name> asap as well.

-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
   |  Memorial Sloan-Kettering Cancer Center
   |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact




        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to