Grokbase Groups R r-help April 2012
FAQ
Hi,

I have a data.frame which contains timeseries from several different
locations, which I want to compare against each other for example
calculating RMSE, or normalized mean bias of each location against the
others. An example of this is the cor function where I can put in a
data.frame and get the correlation of each location compared to the
others in the data.frame eg.
cor(data.frame(a=runif(10),b=runif(10),c=runif(10),d=runif(10)))

Is there any generic way of getting this for other functions, such as
the aggregate or lapply functions? I have read their documentation, but
was unclear as to how I might use them to get a matrix like the cor
function. I could do this using a pair of loops, but was hoping there
might be a more general way of creating such a matrix of any comparison
function.

Thank you for your help,

--

Neil Davis
Ph.d.-student
DTU Wind Energy

Technical University of Denmark


Department of Wind Energy
Ris? Campus Frederiksborgvej 399, P.O. Box 49
Building 125
4000 Roskilde
Direct +45 46775067
neda at dtu.dk <mailto:neda@dtu.dk>
www.dtu.dk <http://www.dtu.dk>

Search Discussions

  • David Winsemius at Apr 26, 2012 at 2:20 pm

    On Apr 26, 2012, at 9:29 AM, Neil Davis wrote:

    Hi,

    I have a data.frame which contains timeseries from several different
    locations, which I want to compare against each other for example
    calculating RMSE, or normalized mean bias of each location against
    the others. An example of this is the cor function where I can put
    in a data.frame and get the correlation of each location compared to
    the others in the data.frame eg.
    cor(data.frame(a=runif(10),b=runif(10),c=runif(10),d=runif(10)))

    Is there any generic way of getting this for other functions, such
    as the aggregate or lapply functions? I have read their
    documentation, but was unclear as to how I might use them to get a
    matrix like the cor function. I could do this using a pair of loops,
    but was hoping there might be a more general way of creating such a
    matrix of any comparison function.
    Perhaps you are looking for:

    ?tapply

    --
    David Winsemius, MD
    West Hartford, CT

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupr-help @
categoriesr
postedApr 26, '12 at 1:29p
activeApr 26, '12 at 2:20p
posts2
users2
websiter-project.org
irc#r

2 users in discussion

Neil Davis: 1 post David Winsemius: 1 post

People

Translate

site design / logo © 2017 Grokbase