[R-SIG-Finance] Hello

Martin Maechler maechler at stat.math.ethz.ch
Wed Jul 7 09:00:30 CEST 2010


>>>>> "S" == Sarbo  <cmdr_rogue at hotmail.com>
>>>>>     on Mon, 05 Jul 2010 15:52:45 -0400 writes:

    S> 1) Try using the "cbind" function to combine to arrays by columns. This
    S> will work for both the "matrix" and "data.frame" data types, so that
    S> when you combine two arrays the first will be "stacked" on top of the
    S> other.
    S> 2) One of the many great things about R is the ease with which you can
    S> lookup things in a data.frame array. For instance, let's say I've got a
    S> a data.frame full of numerical price data, with row names consisting of
    S> the observation dates. Call my array "x". Then, to find the price in
    S> column 3 on June 25th 2010 (for instance), all I have to do is type:

    S> x[rownames(x) == '2010-06-25', 3]

OOOUUUCH!

if it's really the rownames, then *PLEASE* use 

       x['2010-06-25', 3]

that's what row and column names are for !!

Martin



More information about the R-SIG-Finance mailing list