[R] putting a column name on a zoo object

Leeds, Mark (IED) Mark.Leeds at morganstanley.com
Tue Nov 14 22:38:55 CET 2006


let me try colnames. I thought I tried that earlier and got an error
but I've been wrong before.
 Thanks.


-----Original Message-----
From: Horace Tso [mailto:Horace.Tso at pgn.com] 
Sent: Tuesday, November 14, 2006 4:29 PM
To: Leeds, Mark (IED); r-help at stat.math.ethz.ch
Subject: Re: [R] putting a column name on a zoo object

Mark,

What's wrong with the following,

> head(sp.z)
              Open    High     Low   Close     Volume Adj..Close.
2000-01-03 1469.25 1478.00 1438.36 1455.22  931800000     1455.22
2000-01-04 1455.22 1455.22 1397.43 1399.42 1009000000     1399.42
2000-01-05 1399.42 1413.27 1377.68 1402.11 1085500032     1402.11
2000-01-06 1402.11 1411.90 1392.10 1403.45 1092300032     1403.45
2000-01-07 1403.45 1441.47 1400.73 1441.47 1225200000     1441.47
2000-01-10 1441.47 1464.36 1441.47 1457.60 1064800000     1457.60

 colnames(sp.z)
[1] "Open"        "High"        "Low"         "Close"       "Volume"   
 
[6] "Adj..Close."

> colnames(sp.z)[1] = "OPEN"

> colnames(sp.z)
[1] "OPEN"    "High"        "Low"         "Close"       "Volume"     
[6] "Adj..Close."

HTH.

Horace W. Tso

 


>>> "Leeds, Mark (IED)" <Mark.Leeds at morganstanley.com> 11/14/2006
1:21:33 PM >>>
does anyone know how to put a column name on a zoo object. I think achim
and gabor are off line or they have gotten totally tired of me an
decided to ignore me ( which is totalyy understandable ).

logbidask<-log((aggfxdata[,"bid"] + aggfxdata[,"ask"])/2.0) logbidask
doesn't have a name and I can't figure out how to get one on it ?

aggfxdata is a zoo object.
--------------------------------------------------------

This is not an offer (or solicitation of an offer) to
buy/se...{{dropped}}

______________________________________________
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.
--------------------------------------------------------

This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}



More information about the R-help mailing list