[R] Count unchanged class attribute

John Kane jrkrideau at inbox.com
Wed May 20 07:54:29 CEST 2015


John Kane
Kingston ON Canada

-----Original Message-----
From: gunter.berton at gene.com
Sent: Tue, 19 May 2015 20:04:58 -0700
To: jrkrideau at inbox.com
Subject: Re: [R] Count unchanged class attribute

Probably "or what."

This demonstrates a fundamental conundrum: many users or prospective users of R have had little exposure to data structures in their formal education and therefore can be flummoxed by R's fussiness -- as any programming language must necessarily be. Consider: data frames, matrices, lists, "classes", objects with attributes (e.g. factors),...
==========================
Nonsense, I am sure that weird feeling that my brain was being wrung out like a dishcloth, that I felt for the first 3-5 weeks was due to something I ate and had nothing to due with SPSS or SAS.



===========================


Excel, which is basically structureless, of course, exacerbates the problem. Those accustomed to its tolerance (and the confusion that results) expect R to behave the same way. Education is the only recourse, either in formal courses or through R tutorials that strongly emphasize this aspect of interacting with R and especially writing effective code. But that demands effort and, to some extent, aptitude... both of which seem to be in increasingly short supply amidst the worldwide explosion in R's usage.
================================
I don't think it's lack of aptitude but  I seldom see much in the various tutorials and books that really emphasis data structures or typing so people can spend a lot of time figuring out what a list is. Who, me?

I agree that Excel is scary. I believe I mentioned before that I live in fear that some medical spreadsheet will calculate a medical dose on my telephone number rather than my weight.  Of course, Excel being Excel, it would probably obligingly translate a character-formatted telephone number into a real number. I must try this the next time I get close to a machine with Excel.  
===============================
Of course, feel free to disagree... Just my $.02

Cheers,

Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge is certainly not wisdom."
Clifford Stoll

On Tue, May 19, 2015 at 7:02 PM, John Kane <jrkrideau at inbox.com> wrote:

	Is this a list of data.frames or what?

 Please have a look at one or both of these for some ideas of how to ask a question and provide information on the problem.  The better you can describe what you have and what you need the better people can help.
 http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example] and http://adv-r.had.co.nz/Reproducibility.html [http://adv-r.had.co.nz/Reproducibility.html]

 John Kane
 Kingston ON Canada

 > -----Original Message-----
 > From: soe.xiyan at gmail.com
 > Sent: Tue, 19 May 2015 23:37:13 +0700
 > To: r-help at r-project.org
 > Subject: [R] Count unchanged class attribute
 >
 > Maybe someone can help me.
 > Suppose I have data-set like this:
 >
 >   Netto   Bruto  class
 > 1 10      1000    yes
 > 2 100     20      yes
 >
 >
 >   Netto   Bruto  class
 > 1 101     1000    yes
 > 2 100     210     no
 >
 >
 >   Netto   Bruto  class
 > 1 10      10      yes
 > 2 12      28      yes
 > 3 100     20      yes
 >
 >   Netto   Bruto  class
 > 1 120     200     no
 > 2 400     20      yes
 >
 >
 >   Netto   Bruto  class
 > 1 110     12000   yes
 > 2 1100    120     yes
 > 3 120     100     yes
 > 4 1140    125     yes
 >
 > How to calculate the number of classes has changed.
 > The expected result is
 > - class changed    2
 > - class unchanged  3
 >
 >
 > Thank you so much.
 > Soe Xiyan
 >
 >       [[alternative HTML version deleted]]
 >
 > ______________________________________________
 > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
 > https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]
 > PLEASE do read the posting guide
 > http://www.R-project.org/posting-guide.html [http://www.R-project.org/posting-guide.html]
 > and provide commented, minimal, self-contained, reproducible code.

 ____________________________________________________________
 Can't remember your password? Do you need a strong and secure password?
 Use Password manager! It stores your passwords & protects your account.

 ______________________________________________
 R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
 https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html [http://www.R-project.org/posting-guide.html]
 and provide commented, minimal, self-contained, reproducible code.

____________________________________________________________
Can't remember your password? Do you need a strong and secure password?
Use Password manager! It stores your passwords & protects your account.



More information about the R-help mailing list